- or download this
sub imap {
my ($transform, $it) = @_;
...
return $transform->($next);
}
}
- or download this
#!/usr/bin/env perl
use 5.010;
...
my @a = ( "1", "2", "3", "4", );
my @b = foo { $_ ** 2 } @a;
- or download this
my @b = foo { $_ = shift; $_ ** 2 } @a;
my @b = foo { my $var = shift; $var ** 2 } @a;
- or download this
#!/usr/bin/env perl
use 5.010;
...
my @a = ( "1", "2", "3", "4", );
my @b = foo { $_ ** 2 } @a;