in reply to Perl debug. How do I find calling line number?

Obviously it would be nicer if you can trace the call stack, or the chain of exceptions. However, in this case, you yourself actually made the situation difficult. Why not die with some meaningful message? In pratical you should always call die with a meaningful hint:

print "Hello\n"; a(0); print "Middle\n"; a(1); print "Goodbye\n"; sub a { $parameter = shift; if( $parameter ) { die "parameter = $parameter\n"}; }

Lots of time, there are simple answers to difficult situations.

Replies are listed 'Best First'.
Re^2: Perl debug. How do I find calling line number?
by Anonymous Monk on Sep 26, 2004 at 16:59 UTC
    It is not always possible to arrange for a graceful death.

    The script that inspired my question dynamically generated arguments, and the failure was based on complex conditions. I really DID need to know what line it came from. Printing out the bad argument (which I did do) was not enough.