Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Slicing a hash reference from a collection of hash references within a hash reference

by nysus (Parson)
on Oct 07, 2015 at 15:21 UTC ( #1144070=perlquestion: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    $household = { 23 => { last => 'Smith', first => 'Mary' }, 
                   22 => { last => 'Jones', first => 'Bob' }
    };
    
  2. or download this
    my $key = 23;
    my $person = $household->{$key};
    my %name = %$person;
    my @slice = @name{'first', 'last'};
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1144070]
Front-paged by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (1)
As of 2021-05-19 02:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Perl 7 will be out ...





    Results (186 votes). Check out past polls.

    Notices?