Hi All,
Could you please explain the difference b/w the below codes?
when qq is used with eval and without () the o/p is different.
-
-
$hex1='\xd1';
-
-
$conv = eval qq "$hex1";
-
-
print "CONV IS $conv \n";
-
-
o/p is as follows
CONV IS SCALAR(0x183f1c4)
-
-
$hex1='\xd1';
-
-
$conv = eval qq ("$hex1");
-
-
print "CONV IS $conv \n";
-
-
o/p is as follows
CONV IS ╤
In the first example, the double-quotes are the delimiter for the qq operator, so the code is the same as:
-
$hex1='\xd1';
-
$conv = eval $hex1;
-
print "CONV IS $conv \n";
-
In the second example the () are the delimiter for the qq operator, so the code is the same as:
-
$hex1='\xd1';
-
$conv = eval "\"$hex1\"";
-
print "CONV IS $conv \n";
-