note
muba
<p><i>The actual reason you aren't substituting properly is that you are printing @L1, but that array never gets modified by your substitution which acts on $line. </i></p>
<p>Not true:</p>
<c>
my @L1 = qw(Abc aBc abC);
for my $line (@L1) {
$line =~ s/a/_/i;
print "\@L1: <", join(", ", @L1), ">; \$line: <$line>\n";
}
__END__
@L1: <_bc, aBc, abC>; $line: <_bc>
@L1: <_bc, _Bc, abC>; $line: <_Bc>
@L1: <_bc, _Bc, _bC>; $line: <_bC>
</c>
977513
977518