use strict; use warnings; my %hash = ( 1 => 'one' , 2 => 'two' , 3 => 'three' ); my (@one, @two); (push @one , $hash{$_}), push @two, $_ foreach ( keys %hash ); print "@one\n@two"; #### one three two 1 3 2