And should I fear trying to do more than one "semicolon-separated thing" on the left side of an if/unless statement?
Yes :-). I'd use do{...} over eval{...} because do doesn't have the nasty habit of eating fatal errors unless I explicitly check for them. I'd still reverse the logic and put the consequent to the right side:
perl -e 'my $type="blee"; if ($type ne "newer" and $type ne "older") { + print "bad type\n"; print "blee\n"}'
In reply to Re: Should I fear eval? (want to do two things on the left side of an if/unless)
by Corion
in thread Should I fear eval? (want to do two things on the left side of an if/unless)
by tphyahoo
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |