A
arif.rahim
HI,
I have two blocks of code that gives different result for eval.
The first block in online mode:
# perl
$tt='$wrong_value=~/NOT/';
$wrong_value="NOT me";
if ( eval $tt ) { print "RESULT >> That was not you \n"; }
------- Output ---------------------
RESULT >> That was not you
same code in "perl -e"
#perl -e '$tt='$wrong_value=~/NOT/'; $wrong_value="NOT me"; if ( eval
$tt ) { print "RESULT >> That was not you \n"; }'
-------Output-----------------------
[NO output]
Can you please explain what is happening here?
regards,
Arif
I have two blocks of code that gives different result for eval.
The first block in online mode:
# perl
$tt='$wrong_value=~/NOT/';
$wrong_value="NOT me";
if ( eval $tt ) { print "RESULT >> That was not you \n"; }
------- Output ---------------------
RESULT >> That was not you
same code in "perl -e"
#perl -e '$tt='$wrong_value=~/NOT/'; $wrong_value="NOT me"; if ( eval
$tt ) { print "RESULT >> That was not you \n"; }'
-------Output-----------------------
[NO output]
Can you please explain what is happening here?
regards,
Arif