http://www.perlmonks.org?node_id=516764


in reply to Simplifying for loop and applying multiple push function

use strict; use warnings; my %hash = ( 1 => 'one', 2 => 'two', 3 => 'three' ); my(@one,@two); while ( my ( $key, $val ) = each %hash ) { push @one, $val; push @two, $key; }