Re: really bad use of postfix
- From: krahnj@xxxxxxxxx (John W. Krahn)
- Date: Sat, 28 Apr 2007 18:37:20 -0700
Ken Foskey wrote:
Just like to show how NOT to use postfix. I have had a frustrating day
tackling this type of unreadable code.
exec_rqst('stga2k_vps.pl',$FileNameIn) if ($a2kqual[4] eq
"VPS");
exec_rqst('stga2kif.sh',$FileNameIn) if ($a2kqual[4] ne
"VPS");
if ($a2kqual[4] eq "VPS") {
exec_rqst('stga2k_vps.pl',$FileNameIn);
}
else {
exec_rqst('stga2kif.sh',$FileNameIn);
}
How about this?
exec_rqst(
$a2kqual[ 4 ] eq 'VPS' ? 'stga2k_vps.pl' : 'stga2kif.sh',
$FileNameIn
);
John
--
Perl isn't a toolbox, but a small machine shop where you can special-order
certain sorts of tools at low cost and in short order. -- Larry Wall
.
- References:
- really bad use of postfix
- From: Ken Foskey
- really bad use of postfix
- Prev by Date: really bad use of postfix
- Next by Date: Re: File::Basename issues
- Previous by thread: really bad use of postfix
- Next by thread: Re: really bad use of postfix
- Index(es):
Relevant Pages
|
|