in reply to Slicing a hash reference from a collection of hash references within a hash reference
First thing is, use strict; and use warnings;. There are syntax errors in the code you specified.
Here's one way to extract out the hash slice you need...
use warnings; use strict; my $household = { 23 => { last => 'Smith', first => 'Mary' }, 22 => { last => 'Jones', first => 'Bob' }, }; my $name = join ' ', @{ $household->{23} }{'first', 'last'};
-stevieb
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Slicing a hash reference from a collection of hash references within a hash
by nysus (Parson) on Oct 07, 2015 at 15:40 UTC |