use warnings; use strict; my %hash = (4 => 12, 34 => 102); while (my ($k, $v) = each %hash){ print "$k => $v\n"; }