use strict; use warnings; use feature 'say'; use Data::Dumper; my %hash = ( foo => 'bar', baz => 'qux', ); say 'Hash: ' . Dumper %hash; ## Output: # Hash: $VAR1 = 'foo'; # $VAR2 = 'bar'; # $VAR3 = 'baz'; # $VAR4 = 'qux'; say 'As hashref: ' . Dumper \%hash; ## Output: # As hashref: $VAR1 = { # 'foo' => 'bar', # 'baz' => 'qux' # }; #### say "$_ : $hash{ $_ }" for keys %hash;