Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
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
Domain Nodelet?
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 romping around the Monastery: (3)
As of 2023-06-11 00:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How often do you go to conferences?






    Results (40 votes). Check out past polls.

    Notices?