Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hi all,

I have 3 different variables like:

my $tmp = 4; my $tmp1 = 37; my $tmp2 = "<="; #Now I want to use all these variables in if condition if($tmp2 $tmp1 $tmp) { print "Error"; } else { print "ok"; }

Now I am getting error at "IF" condition as "Scalar found where operator expected" Could anyone please tell me how to use $tmp2 in if condition.

Thanks --girija

Replies are listed 'Best First'.
Re: How to convert Scalar operator (calculator)
by Anonymous Monk on Aug 14, 2015 at 08:33 UTC