is never elegant. I'll always plump forunless ($expression){ # do something }
especially if, as in this case $expression includes some boolean arithmetic. I do use it for early exits from loops though. I can readif (not $expression){ # do something }
without too much trouble (as long as it's simple).while (<$fh>){ next unless /\S/; # }
As soon as an expression has a not an and and an or in it I'm almost sure to get it wrong and it often points to a poor algorithm which some refactoring can fix. Either that or put it into sub so I can say
and test the living daylights out of it.if (work_to_do($args)){ # do some work }
Did I mention I've had awful trouble with boolean arithmetic? :-)
In reply to Re^2: This is why Perl is so frustrating
by wfsp
in thread This is why Perl is so frustrating
by eggmatters
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |