Do be aware that there are security considerations to using eval to arbitrarily evaluate a user-supplied chunk of Perl syntax.my $attribute = 3; my $condition = '$attribute == 3 or $attribute == 4'; print +((eval $condition)? "TRUE" : "FALSE", ($@)? " (warning: $@)" : '', $/);
--
[ e d @ h a l l e y . c c ]
In reply to Re: Parsing conditional expressions
by halley
in thread Parsing conditional expressions
by Lorand
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |