in reply to Re^4: How to pass a variable string as conditional argument to if statment
in thread How to pass a variable string as conditional argument to if statment

Are you checking for errors after the eval ?

#!perl use strict; my @test = ('10>5','10<5','13+2==14+1','4>(6/2)+1'); for my $var (@test){ my $result = eval $var ? 'True' : 'False'; die $@ if $@; # check for errors in eval print "$var is $result\n"; }
poj
  • Comment on Re^5: How to pass a variable string as conditional argument to if statment
  • Download Code