- or download this
my %hash = ( ... );
map { $hash{$_} = ($hash{$_} * 2) } keys %hash;
- or download this
my %hash = ( ... );
my %new_hash = map { $_ => ($hash{$_} * 2) } keys %hash;
- or download this
sub length {
my ($h, @t) = @_;
return 0 unless defined $h;
return 1 + length(@t);
}