Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask

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?

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

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (3)
As of 2024-04-13 05:28 GMT
Find Nodes?
    Voting Booth?

    No recent polls found