- or download this
for (@array) {
if (condition($_)) {
$_ = transform($_);
}
}
- or download this
$_ = transform($_) for grep condition($_), @array;
- or download this
my @array = qw( John Jake and Jasper );
$_ = uc($_) for grep /^a/, @array;
print("@array\n"); # John Jake AND Jasper