On 11 Jan 2004 17:33:32 -0000, Peter Scott wrote:
> In article <[EMAIL PROTECTED]>,
> [EMAIL PROTECTED] (Gabor Szabo) writes:
>>
>> Any idea how can I use the debugger to find the cause of
>> a deep recursion in my code ?
>
> I don't see the need for the debugger.  Deep recursion is a
> warning, so
> just turn the warning into a fatal error with stack trace:
>
> % perl -MCarp=confess -we '$SIG{__WARN__} = sub {confess @_ }; \
> sub foo { foo() } foo'

Since this will turn ALL warnings into errors, you will have to make sure you don't 
have any warning-causing code in your program before you get to the recursion. You 
will also have to throw the -w switch when you call perl (as specified in the example 
above). If you currently are not running with -w (or use warnings;), be prepared for 
some cleanup work.
--
Matthew O. Persico


Reply via email to