On 7/31/07, <b class="gmail_sendername">Dan Linder</b> &lt;<a href="mailto:dan@linder.org">dan@linder.org</a>&gt; wrote:<div><span class="gmail_quote"></span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Jay Hannah wrote:<br>&gt; But what is a fatal &quot;Substitution loop&quot; error from Perl?<br>&gt;<br>&gt; I&#39;ve never seen that one before. It disappeared without me changing<br>&gt; anything and I can&#39;t make it happen again.
<br>&gt;<br>&gt; Probably user error.&nbsp;&nbsp; :)<br>&gt;<br> From &quot;<a href="http://search.cpan.org/~nwclark/perl-5.8.8/pod/perldiag.pod">http://search.cpan.org/~nwclark/perl-5.8.8/pod/perldiag.pod</a>&quot;:<br>Substitution loop : (P) The substitution was looping infinitely.
<br>(Obviously, a substitution shouldn&#39;t iterate more times than there are<br>characters of input, which is what happened.) See the discussion of<br>substitution in &quot;Quote and Quote-like Operators&quot; in perlop.
<br><br>I can&#39;t see how the simple &quot;$d1=~s/[^\d]//g;&quot; could cause the loop as<br>described above -- what happens if $d1 was all numbers - if there is a<br>bug in the length check, then it could count X characters but try to run
<br>X+1 times and get that error...&nbsp;&nbsp;(Just a shot in the dark, though.)<br><br>Do you have a way of catching the error next time and logging the<br>initial contents of $d1?<br><br>Dan<br><br>--<br>- - - -<br>&quot;Wait for that wisest of all counselors, time.&quot; -- Pericles &quot;I do not
<br>fear computers, I fear the lack of them.&quot; -- Isaac Asimov<br><br><br>_______________________________________________<br>Omaha-pm mailing list<br><a href="mailto:Omaha-pm@pm.org">Omaha-pm@pm.org</a><br><a href="http://mail.pm.org/mailman/listinfo/omaha-pm">
http://mail.pm.org/mailman/listinfo/omaha-pm</a><br></blockquote></div><br><br>i bet it depends on the content of the string input - if you have all digits, i bet you do not get an error.&nbsp; Doesn&#39;t it mean that you putting into the s string a character that is not a number, so it is replaced again, then removed again, replaced ad infinitum.&nbsp; 
<br>