use warnings; use strict; my $household = { 23 => { last => 'Smith', first => 'Mary' }, 22 => { last => 'Jones', first => 'Bob' }, }; my $name = join ' ', @{ $household->{23} }{'first', 'last'};