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 |