in reply to Sub hash param by reference

You can pass the whole hash by reference, then deref what you want using a hash slice if that's what you mean. Otherwise, what's the point if it's all by reference?

(tested on 5.22.1) See perldata for more info.
use strict; use warnings; use Data::Dumper; sub slice_by_ref { my $h = shift; my %subset = %$h{'foo', 'bar'}; print Data::Dumper::Dumper(\%subset); } my $h = {blonk => 2, foo => 3, squink => 5, bar => 8}; slice_by_ref($h);
OUTPUT:
$VAR1 = { 'foo' => 3, 'bar' => 8 };