Help for this page

Select Code to Download


  1. or download this
    @new_hashes = map{ my $x = $_; +{ map { $_=>$x->{$_} } @wanted_keys } 
    +} @old_hashes;
    
  2. or download this
    @new_hashes = map { my %x; @x{@wanted_keys}=@$_{@wanted_keys}; \%x } @
    +old_hashes; # untested
    
  3. or download this
    @cols = (split(' ', $data, 4),
             (map scalar reverse, reverse split(' ', reverse($data), 4))[1
    +..3]);
    
  4. or download this
    @cols = split(' ', $data, 4);
    @cols[7,6,5,4,3] = map scalar reverse, split ' ', reverse($cols[3]), 5
    +;
    
  5. or download this
    @cols = ((split(' ', $data, 4))[0..2], reverse map scalar reverse, spl
    +it ' ', reverse((split ' ', $data, 4)[-1]), 5);