Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Improving the Error Handling of my Scripts

by Hue-Bond (Priest)
on Mar 11, 2010 at 08:38 UTC ( #827982=note: print w/ replies, xml ) Need Help??


in reply to Improving the Error Handling of my Scripts

I do not like the fact that the line number is static and I have to remember to update it if I ever modify the script (I won't remember).

Use __LINE__ for that:

use warnings; use strict; printf "I'm in line %d\n", __LINE__; printf "I'm in line %d\n", __LINE__; printf "I'm in line %d\n", __LINE__; __END__ I'm in line 4 I'm in line 5 I'm in line 6

--
 David Serrano
 (Please treat my english text just like Perl code, i.e. feel free to notify me of any syntax, grammar, style and/or spelling error. Thank you!).


Comment on Re: Improving the Error Handling of my Scripts
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (11)
As of 2015-07-29 22:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (269 votes), past polls