<?xml version="1.0" encoding="windows-1252"?>
<node id="977525" title="Re^2: Perl substitution not working" created="2012-06-20 20:53:30" updated="2012-06-20 20:53:30">
<type id="11">
note</type>
<author id="333489">
muba</author>
<data>
<field name="doctext">
&lt;p&gt;&lt;i&gt;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. &lt;/i&gt;&lt;/p&gt;

&lt;p&gt;Not true:&lt;/p&gt;

&lt;c&gt;
my @L1 = qw(Abc aBc abC);
for my $line (@L1) {
    $line =~ s/a/_/i;
    print "\@L1: &lt;", join(", ", @L1), "&gt;; \$line: &lt;$line&gt;\n";
}

__END__
@L1: &lt;_bc, aBc, abC&gt;; $line: &lt;_bc&gt;
@L1: &lt;_bc, _Bc, abC&gt;; $line: &lt;_Bc&gt;
@L1: &lt;_bc, _Bc, _bC&gt;; $line: &lt;_bC&gt;
&lt;/c&gt;</field>
<field name="root_node">
977513</field>
<field name="parent_node">
977518</field>
</data>
</node>
