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!).
In reply to Re: Improving the Error Handling of my Scripts
by Hue-Bond
in thread Improving the Error Handling of my Scripts
by Dru
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |