http://www.perlmonks.org?node_id=1144070

nysus has asked for the wisdom of the Perl Monks concerning the following question:

This is an embarrassingly newbie question, but I have a mental block when it comes to references. Given the following simple data structure, how do I get a slice of the name data?
$household = { 23 => { last => 'Smith', first => 'Mary' }, 22 => { last => 'Jones', first => 'Bob' } };
Here's my newbie code that works:
my $key = 23; my $person = $household->{$key}; my %name = %$person; my @slice = @name{'first', 'last'};
How do I turn this into a one liner?

 

$PM = "Perl Monk's";
$MCF = "Most Clueless Friar Abbot Bishop Pontiff Deacon";
$nysus = $PM . $MCF;
Click here if you love Perl Monks