use strict; use warnings; my %ahash=(one=>1, two=>2, three=>3, foo=>'$foo'); print join(", ", map { "'$_' => '$ahash{$_}'"} keys %ahash ), "\n"; __END__ 'three' => '3', 'one' => '1', 'foo' => '$foo', 'two' => '2'