in reply to Predefined Variable

die does print the line number - unless the last argument to die ends with a new-line. For example:

perl -e 'die "I died"' outputs "I died at -e line 1." (note the line #)

If "die" alone doesn't do what you need, __LINE__ should (in most cases).