Help for this page

Select Code to Download


  1. or download this
    my @arr1;
    @arr1 = map { push @arr1, ($_+ 2) } @data;
    
  2. or download this
    my @dataPlus2 = map { my $bullshit = 'XYZ'; #see below
                          $_ + 2
                        }@data;
    
  3. or download this
    foreach my $root (map { sqrt($_) }@data)
    {
       #do something with this square root...
    }