Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic

Re^2: Question regarding hash with multiple values

by Skeeve (Vicar)
on Jul 10, 2013 at 18:35 UTC ( #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.


Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1043528]
[davido]: I have nvidia (1050ti) in one system at home. My work laptop came with a radeon/amd video system that is no longer supported by debian/ubuntu. So that being the case I'm in the "prefer nvidia even if proprietary" camp
[davido]: Especially since the laptop is only a couple years old.

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (8)
As of 2017-05-26 14:30 GMT
Find Nodes?
    Voting Booth?