in reply to Search & Replace in an Array

A generic form for a generic question:

for (@array) { if (condition($_)) { $_ = transform($_); } }
The above can also be written as
$_ = transform($_) for grep condition($_), @array;
For example,
my @array = qw( John Jake and Jasper ); $_ = uc($_) for grep /^a/, @array; print("@array\n"); # John Jake AND Jasper