Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re^3: Peculiar hash behavior

by ikegami (Patriarch)
on Oct 04, 2021 at 19:30 UTC ( [id://11137215]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Peculiar hash behavior
in thread Peculiar hash behavior

The array emulation is another one of those things I've read about a few times and never really understood well enough to be safe around :-) .

$h{$x, $y, ...}
is short for
$h{join $;, $x, $y, ...}

That's it.

As long as your keys don't contain the value in $; (which is a control character by default), you can emulate multi-level hashes. It presumably uses less memory, but it might be a bit slower from concatenating the keys??? Of course, you're relying on the value of $; being safe.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (6)
As of 2024-04-20 00:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found