So just as you might have this:
@a = (1,2,3); print @a[1,2];and get '23', then you might have this:
%a = qw(alpha 1 beta 2 gaga 3);
print @a{ qw(beta gaga) };
and also get '23'.
NB that it is an @ and not a % as the first character there.
To slice a hash reference just replace @a above with @$r or @{$r} .
(New) You can also slice in a sort of 'select column' way, where your result is a subset of the hash's keys and values rather than just values:
%a = qw(alpha 1 beta 2 gaga 3);
%b = %a{ qw(beta gaga) };
and end up with %b being (beta => 2, gaga => 3);
To do that with a reference, replace %a above with %$r or %{$r} .
This works in Perl 5.24 but not in 5.8.2 .