- or download this
my @in = qw(aaa bbb ccc);
my @out = map { local $_ = $_; s/.$/x/; $_ } @in;
print "@in\n=>\n@out\n";
- or download this
my @out = map { (my $s = $_) =~ s/.$/x/; $s } @in;
- or download this
my $_;
# ...
my @out = map { s/.$/x/; $_ } @in;