http://qs321.pair.com?node_id=80453


in reply to How do I take a slice of a hash reference?

Another way to get a slice from a hash reference is:

my $hashref = { a => 1, b => 2, c => 3, d => 4, }; #Pull out elements a and d from the hashref my @slice = @$hashref{ qw(a d) };

Originally posted as a Categorized Answer.