use strict; use warnings; my %h = (foo => 1, bar => 2, foobar => 3); my $hashref = \%h; print $hashref, "\n"; # prints HASH(0x.......); for (keys(%$hashref)) { print "$_ => $hashref->{$_}\n"; }