And this reminds me of another reason why I don't use Data::Dumper. It defaults to being "efficient" and so doesn't actually 'dump' the variable contents, in an effort to avoid the arduous task of escaping all those weird characters. You have to go out of your way to tell Data::Dumper to "useqq" for it to actually dump strings in a fool-proof manner.
> perl -del
# ...
DB<4> print Dumper("\c\\-10")
$VAR1 = '-10';
DB<5> print Data::Dumper->new(["\c\\-10"])->Useqq(1)->Dump()
$VAR1 = "\34-10";
DB<6>
The unescaped CTRL-\ removed from the above output as how it would be displayed would depend on several things and it didn't even remain a CTRL-\ after being copy-n-pasted into the browser and converted to Latin-1 etc. anyway.
Update: Oh, I thought Zaxo had noted what "^\" represents but I see he didn't so, to be very clear, "^\" is how perl is safely dumping a single CTRL-\ ("\c\\") character in that warning, which is why my example code looks like it does. No, I didn't realize this when first viewing the warning.
|