sub test { while ( my ($key, $value) = each( {@_} ) ){ #or { $_[0] } with the same result } }