<?xml version="1.0" encoding="windows-1252"?>
<node id="1013271" title="Re: using map and swap (aka substitute)" created="2013-01-14 15:24:29" updated="2013-01-14 15:24:29">
<type id="11">
note</type>
<author id="171588">
BrowserUk</author>
<data>
<field name="doctext">
&lt;blockquote&gt;&lt;i&gt;&lt;/i&gt;&lt;/blockquote&gt;
&lt;p&gt;Since you are overwriting the original array with the results, the simplest solution is:&lt;code&gt;
s/_string$// for @list;
&lt;/code&gt;

&lt;P&gt;Which mutates the array in-place, thus avoids constructing two lists (in and out of [map]) as well as 'curing' the perceived problem.

&lt;P&gt;And if you wanted to create a new list from the modified values whilst retaining the original array unmodified, I'd probably do it this way also:&lt;code&gt;
my @list = ...;
my @newList = @list;
s/_string$// for @newList;
&lt;/code&gt;


&lt;div class="pmsig"&gt;&lt;div class="pmsig-171588"&gt;
&lt;hr /&gt;
&lt;font size=1 &gt;
&lt;div&gt;With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'&lt;/div&gt;
&lt;div&gt;Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.&lt;/div&gt;
&lt;div&gt;"Science is about questioning the status quo. Questioning authority". &lt;/div&gt;
&lt;div&gt;In the absence of evidence, opinion is indistinguishable from prejudice.
&lt;/div&gt;
&lt;/font&gt;

&lt;/div&gt;&lt;/div&gt;
</field>
<field name="root_node">
1013266</field>
<field name="parent_node">
1013266</field>
</data>
</node>
