|Just another Perl shrine|
Should I fear eval? (want to do two things on the left side of an if/unless)by tphyahoo (Vicar)
|on Aug 10, 2006 at 12:14 UTC||Need Help??|
tphyahoo has asked for the
wisdom of the Perl Monks concerning the following question:
I cooked up the following one liner
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.
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?
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 :)