use Data::Dumper; my %h1 = qw(foo 1 bar 1 baz 1); my %h2 = %h1; print Dumper(\%h2); __output__ $VAR1 = { 'foo' => '1', 'bar' => '1', 'baz' => '1' };