sub increment { $_++ foreach @_; } my %hash = qw(a 1 b 2 c 3); increment(%hash); print "$_ => $hash{$_}\n" for sort keys %hash;