R
raksha34
Hi,
perl -le '
### this part works
$var=sprintf "%d", 0x11;
print $var; ### and we get 17 output
$_ = "{0x11}";
#s/(0x\d+)/hex($1)/e; #### this part works ok and we see
a {17} output
s/(0x\d+)/sprintf("%d",$1)/e; #### this part does NOT work and we
see a {0} output
print;
'
Is this some bug in the sprintf or s///e flag?
Thanks,
Rakesh
perl -le '
### this part works
$var=sprintf "%d", 0x11;
print $var; ### and we get 17 output
$_ = "{0x11}";
#s/(0x\d+)/hex($1)/e; #### this part works ok and we see
a {17} output
s/(0x\d+)/sprintf("%d",$1)/e; #### this part does NOT work and we
see a {0} output
print;
'
Is this some bug in the sprintf or s///e flag?
Thanks,
Rakesh