<?xml version="1.0" encoding="windows-1252"?>
<node id="1004810" title="Re: rotate a vector with a regex?" created="2012-11-20 17:20:15" updated="2012-11-20 17:20:15">
<type id="11">
note</type>
<author id="634253">
AnomalousMonk</author>
<data>
<field name="doctext">
&lt;blockquote&gt;&lt;i&gt;
... move it pairwise along the string (bubble it).
&lt;/I&gt;&lt;/BLOCKQUOTE&gt;

&lt;p&gt;
As I understand it, this won't work because substitution is not being done on the original string during the actual substitution process; rather, an intermediate string is being built up during this process, and the intermediate string is copied to the original string when the process is complete.
&lt;/P&gt; 

&lt;p&gt;
That's why something like &lt;br&gt;
&lt;c&gt;    ($x = $y) =~ s{foo}{bar}xms;&lt;/c&gt; &lt;br&gt; 
works as it does: instead of copying the intermediate back to the original string ($y), it's copied to another string ($x) leaving the original string untouched. (Or maybe $x is just used as the 'intermediate' in the first place. Whatever...)
&lt;/P&gt;
</field>
<field name="root_node">
1004804</field>
<field name="parent_node">
1004804</field>
</data>
</node>
