On 7/31/07, <b class="gmail_sendername">Dan Linder</b> <<a href="mailto:dan@linder.org">dan@linder.org</a>> 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>> But what is a fatal "Substitution loop" error from Perl?<br>><br>> I've never seen that one before. It disappeared without me changing<br>> anything and I can't make it happen again.
<br>><br>> Probably user error. :)<br>><br> From "<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>":<br>Substitution loop : (P) The substitution was looping infinitely.
<br>(Obviously, a substitution shouldn't iterate more times than there are<br>characters of input, which is what happened.) See the discussion of<br>substitution in "Quote and Quote-like Operators" in perlop.
<br><br>I can't see how the simple "$d1=~s/[^\d]//g;" 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... (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>"Wait for that wisest of all counselors, time." -- Pericles "I do not
<br>fear computers, I fear the lack of them." -- 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. Doesn'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.
<br>