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