sub printh { my ($x) = @_; warn $_ for keys %$x; } printh(\%h); # Pass a reference