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) };