in reply to Parsing conditional expressions

my $attribute = 3; my $condition = '$attribute == 3 or $attribute == 4'; print +((eval $condition)? "TRUE" : "FALSE", ($@)? " (warning: $@)" : '', $/);
Do be aware that there are security considerations to using eval to arbitrarily evaluate a user-supplied chunk of Perl syntax.

--
[ e d @ h a l l e y . c c ]