use List::Util 'reduce'; my %hash = ( foo => 1, bar => 2, baz => 3 ); my $count = 0; print +( reduce {$a . (++$count % 2 ? ' => ' : ', ') . $b} %hash ), $/; __END__ bar => 2, baz => 3, foo => 1