in reply to Parsing conditional expressions
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 ]
|
|---|