>>>>> "d" == developer <[EMAIL PROTECTED]> writes:
d> I'm researching an error that reports: "Deep recursion on subroutine ..."
d> I've not been able to figure out when (at what level) this warning is
d> actually displayed. I have a test sub that recurses to the 100,000th
d> level, but have not been able to force the warning. A copy of the prog
d> in production displayed this warning in the log though, and while it's
d> possible, it's not plausible that this program actually recursed that
d> far. Typical recursions are in the low 10s.
can you show the test sub? it should be easy to trigger this
warning. also note that the warning will come out on stderr and not stdout.
d> Does anyone have experience with debugging this? Any documentation that
d> explains deep recursion warnings?
i ran into this when i wrote a maze solver (i gave a talk on it at a
meeting last year). i think that warning hits when you get to 100
deep. it can be shut off with a no warnings pragma. toggle the commented
line below and you will see the warning or not at the 100 level mark
uri
#!/usr/local/bin/perl
use warnings ;
use strict ;
recurse( 1 ) ;
sub recurse {
my( $i ) = @_ ;
warn $i if $i > 95 ;
return if $i > 105 ;
#no warnings 'recursion' ;
recurse( $i + 1 ) ;
}
96 at recurse.pl line 13.
97 at recurse.pl line 13.
98 at recurse.pl line 13.
99 at recurse.pl line 13.
Deep recursion on subroutine "main::recurse" at recurse.pl line 19.
100 at recurse.pl line 13.
101 at recurse.pl line 13.
102 at recurse.pl line 13.
103 at recurse.pl line 13.
104 at recurse.pl line 13.
105 at recurse.pl line 13.
106 at recurse.pl line 13.
--
Uri Guttman ------ [EMAIL PROTECTED] -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs ---------------------------- http://jobs.perl.org
_______________________________________________
Boston-pm mailing list
[email protected]
http://mail.pm.org/mailman/listinfo/boston-pm