Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

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

by toolic (Bishop)
on Oct 07, 2015 at 15:36 UTC ( #1144073=note: print w/replies, xml ) Need Help??


in reply to Slicing a hash reference from a collection of hash references within a hash reference

use warnings; use strict; use Data::Dumper; my $household = { 23 => { last => 'Smith', first => 'Mary' }, 22 => { last => 'Jones', first => 'Bob' } }; my @slice = @{ $household->{23} }{qw(first last)}; print Dumper(\@slice); __END__ $VAR1 = [ 'Mary', 'Smith' ];
  • Comment on Re: Slicing a hash reference from a collection of hash references within a hash reference
  • Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (3)
As of 2021-05-16 13:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Perl 7 will be out ...





    Results (151 votes). Check out past polls.

    Notices?