[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Omaha.pm] Substitution loop



Jay Hannah wrote:
But what is a fatal "Substitution loop" error from Perl?

I've never seen that one before. It disappeared without me changing anything and I can't make it happen again.

Probably user error.   :)
From "http://search.cpan.org/~nwclark/perl-5.8.8/pod/perldiag.pod":
Substitution loop : (P) The substitution was looping infinitely. (Obviously, a substitution shouldn't iterate more times than there are characters of input, which is what happened.) See the discussion of substitution in "Quote and Quote-like Operators" in perlop.

I can't see how the simple "$d1=~s/[^\d]//g;" could cause the loop as described above -- what happens if $d1 was all numbers - if there is a bug in the length check, then it could count X characters but try to run X+1 times and get that error... (Just a shot in the dark, though.)

Do you have a way of catching the error next time and logging the initial contents of $d1?

Dan

--
- - - -
"Wait for that wisest of all counselors, time." -- Pericles "I do not
fear computers, I fear the lack of them." -- Isaac Asimov