Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^2: Question regarding hash with multiple values

by Skeeve (Parson)
on Jul 10, 2013 at 18:35 UTC ( [id://1043528]=note: print w/replies, xml ) Need Help??


in reply to Re: Question regarding hash with multiple values
in thread Question regarding hash with multiple values

I'd apply a small change:
use strict; use warnings; use Data::Dumper; my %celebs = ( 'Bob Dole' => { 'address' => '123 peach st.', 'spouse' => 'Bill Clinton', 'father' => 'Frank Dole' }, 'Al Pacino' => { 'address' => '123 orange st.', 'spouse' => 'Robert Deniro', 'father' => 'Marlon Brando' } ); my @people = map { { name => $_, %{$celebs{$_}}, # <- Change is here } } keys %celebs; print Data::Dumper->Dump( [\@people],[qw(*people)] );
So you don't need to "hard code" the celeb's keys.

s$$([},&%#}/&/]+}%&{})*;#$&&s&&$^X.($'^"%]=\&(|?*{%
+.+=%;.#_}\&"^"-+%*).}%:##%}={~=~:.")&e&&s""`$''`"e

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (3)
As of 2024-04-20 15:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found