Pathologically Eclectic Rubbish Lister | |
PerlMonks |
Re: in search of a more elegant if then elseby Anonymous Monk |
on Feb 19, 2010 at 19:03 UTC ( [id://824231]=note: print w/replies, xml ) | Need Help?? |
A more general question is: what are you computing with this if statement?
If it's something interesting and complex, think about whether or not you can factor out some or all the functionality into it's own function, so you can re-use it elsewhere, and test it independently. If it's something simple, then the number of lines you need to code it won't really matter. For example, it's probably better to use this for a complicated condition: but you can use something like this for a simple one...
--
In Section
Seekers of Perl Wisdom
|
|