Help for this page

Select Code to Download


  1. or download this
    #!/usr/bin/perl
    use warnings;
    ...
    my %hash = (key1 => 'val1', key2 => 'val2');
    s/val/V/ for values %hash;
    say "$_ => $hash{$_}" for keys %hash;
    
  2. or download this
    my @old = keys %hash;
    @hash{map uc, @old} = delete @hash{@old};