|P is for Practical|
Get condition for "if statement" from fileby mrguy123 (Hermit)
|on Nov 20, 2012 at 08:41 UTC||Need Help??|
mrguy123 has asked for the
wisdom of the Perl Monks concerning the following question:
Hi monks, say I have a file with conditions for if statements, for example
I want to read the file, and do the if statements, something like this
The problem, of course, is that "if $statement" will be true when $statement is not null (always). What I want is a dynamic if statement, according to the input file, which will only print true for the second statement.
Any ideas how this can be done?
Thanks, Mister Guy
Everybody seems to think I'm lazy
I don't mind, I think they're crazy
UPDATE: Added eval to the code and it works like a charm. Thanks for the help