Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: How to flatten hashes?

by EvanCarroll (Chaplain)
on Jul 14, 2005 at 20:50 UTC ( #475044=note: print w/replies, xml ) Need Help??


in reply to How to flatten hashes?

Because you mentioned "easiest":

EXAMPLE HASH:
my %foo = ( asdf => { foo => 'jkl' }, bar => { foo => 'func' }, );

TRANSFORMATION CODE:
map { $foo{$_} = $foo{$_}->{'foo'} } keys %foo;

Evan Carroll
www.evancarroll.com

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (5)
As of 2019-08-19 20:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    If you were the first to set foot on the Moon, what would be your epigram?






    Results (141 votes). Check out past polls.

    Notices?