Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: quick question about hash element access

by DrHyde (Prior)
on Jun 28, 2003 at 12:20 UTC ( [id://269849]=note: print w/replies, xml ) Need Help??


in reply to quick question about hash element access

Very quick and simple solution:
$hash{a}{b}{c}{d}{e} = 'E'; print getthingy(\%hash, 'a.b.c.d.e'); sub getthingy { my($hash, $key) = @_; $hash = $hash->{$_} foreach(split/\./, $key); $hash; }

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (3)
As of 2024-03-29 01:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found