hmm.. perldoc perlre then to perldoc perlop<br><br>qr// seems like it will do it.<br><br>duh<br><br><br><div><span class="gmail_quote">On 2/1/06, <b class="gmail_sendername">mike</b> <<a href="mailto:mike206@gmail.com">
mike206@gmail.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">oh so i am trying to store a regexp substitution with back references in a few variables and have them interpolate the $1, $2, ....
<br><br>i tried it with the \1 , \2 notation as well with no luck. hrmph. <br><br><div><div><span class="e" id="q_109278a673ec325a_1"><span class="gmail_quote">
On 2/1/06, <b class="gmail_sendername">mike</b> <<a href="mailto:mike206@gmail.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">mike206@gmail.com</a>> wrote:</span></span></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><span class="e" id="q_109278a673ec325a_3">
the comments pretty much speak for themselves. <br>i did that so anyone interested can replicate the problem with a cut and paste. <br><br>---- begin ----<br><br>#!/usr/bin/perl -w
<br><br># here's a regexp <br>my $regexp = q{(abcd)(efg)};<br><br># here's a substitution pattern
<br># note the single q{} to block it from interpolating <br>my $suss = q{$2 $1};<br><br># here's a string
<br>my $string = q{abcdefgh};<br><br># run the regexp and putout <br>$string =~ s/$regexp/$suss/;<br>print $string."\n";
<br><br>############################ prints '$2 $1h' <br><br># now try again but hardcode the backreferences in the substitution<br><br>$string = q{abcdefgh};<br>$string =~ s/$regexp/$2 $1/;<br>print $string."\n";
<br>################### prints 'efg abcdh' , as it should<br><br><br>
<br></span></div>_____________________________________________________________<br>Seattle Perl Users Group Mailing List<br> POST TO: <a href="mailto:spug-list@pm.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
spug-list@pm.org
</a><br>SUBSCRIPTION: <a href="http://mail.pm.org/mailman/listinfo/spug-list" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://mail.pm.org/mailman/listinfo/spug-list</a><br> MEETINGS: 3rd Tuesdays
<br> WEB PAGE: <a href="http://seattleperl.org/" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://seattleperl.org/</a><br><br></blockquote></div><br>
</blockquote></div><br>