It has an eval in it, because I want to "do two semicolon-separated things" on the left side of an if/unless. What I mean is, if this bit in curly brackets was on the right side of the if/unless, I wouldn't need the eval statement, it would just flow from the syntax.$ perl -e 'my $type="blee"; eval { print "bad type\n"; print "blee\n" +} unless ($type eq "newer" || $type eq "older")' bad type blee
I never ever use eval, here I just kind of popped it out to see what would happen.
So I guess what I'm asking is, other than having that extra "eval" statement, is there something else wrong with what I am doing here?
Should I fear eval?
And should I fear trying to do more than one "semicolon-separated thing" on the left side of an if/unless statement?
UPDATE:
1) Changed single quotes to double quotes.
2) Obviously, I wanted "do" here. Thanks for helping -- I think I got three answers to my question in under 45 seconds, and not a single RTFM. wow :)
In reply to Should I fear eval? (want to do two things on the left side of an if/unless) by tphyahoo
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |