Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: $var{'a',1,...}

by benizi (Hermit)
on May 24, 2005 at 19:19 UTC ( [id://460140]=note: print w/replies, xml ) Need Help??


in reply to Re: $var{'a',1,...}
in thread $var{'a',1,...}

Careful when using Data::Dumper to dump strings.

use Data::Dumper; $h{"a", 1, "b", 2} = 1; $h{a1b2} = 2; print Dumper \%h;
produces the counterintuitive:

$VAR1 = { 'a1b2' => 2, 'a1b2' => 1 };

But:

use Data::Dumper; $h{"a", 1, "b", 2} = 1; $h{a1b2} = 2; $_ = Dumper \%h; s/(\P{IsPrint})/"\\x{".sprintf "%04x}", ord $1/ge; print
reveals:
$VAR1 = { 'a1b2' => 2, 'a\x{001c}1\x{001c}b\x{001c}2' => 1 };

("\x{001c}" eq "\034" eq chr(28) eq $; See first reply.)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://460140]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (6)
As of 2024-04-16 12:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found