in reply to Should I fear eval? (want to do two things on the left side of an if/unless)
Why not just use the more traditional "if/unless" construct?
unless ($type eq 'newer' || $type eq 'older') { print "bad type\n"; print "blee\n"; }
Alternatively, you could use "do":
do { print "bad type\n"; print "blee\n"; } unless ($type eq 'newer' || $type eq 'older');
"eval" is completely inappropriate in this instance. You shouldn't fear using "eval" - just abusing it :-:
"The first rule of Perl club is you do not talk about
Perl club."
-- Chip Salzenberg
|
|---|