Help for this page

Select Code to Download


  1. or download this
    use List::Util qw/sum/;
    say for map_pairs \&sum, 1..10;
    
  2. or download this
    use YAML;
    my @array = ( foo_name => " Bob Smiley ", foo_age => " 32" );
    map_pairs { $a =~ s/foo_//; s/^\s+//, s/\s+$// for $b; } @array;
    ...
    map_pairs { $a =~ s/foo_//; s/^\s+//, s/\s+$// for $b; } %hash;
    
    print Dump \%hash;
    
  3. or download this
    ---
    - name
    - Bob Smiley
    ...
    ---
    foo_age: 32
    foo_name: Bob Smiley