Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Perl debug. How do I find calling line number?

by Corion (Patriarch)
on Sep 26, 2004 at 10:04 UTC ( [id://393913]=note: print w/replies, xml ) Need Help??


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

It sounds to me like Carp and its replacement for die, croak is what you really want here. croak dies "at the place of call" instead of within your module. The source code of Carp.pm should also tell you how to get the information about the line number out of perl. perldoc -f caller also tells you how to get this information yourself.

  • Comment on Re: Perl debug. How do I find calling line number?

Replies are listed 'Best First'.
Re^2: Perl debug. How do I find calling line number?
by tachyon (Chancellor) on Sep 26, 2004 at 11:39 UTC

    I particularly like the confess function of carp. It is just such a good name for what it does *. It captures both the angst and the deeply spiritual nature of debugging in a single word. Confess damnit :-)

    * dies with complete call stack trace

    cheers

    tachyon

Re^2: Perl debug. How do I find calling line number?
by Anonymous Monk on Feb 06, 2008 at 06:01 UTC
    Try this: http://www.perlmonks.org/?node=caller

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://393913]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (7)
As of 2024-04-19 09:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found