in reply to Re: This is why Perl is so frustrating
in thread This is why Perl is so frustrating
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? :-)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: This is why Perl is so frustrating
by talexb (Chancellor) on Jul 30, 2009 at 13:58 UTC |