Theodorus has asked for the wisdom of the Perl Monks concerning the following question:

I am out of curiosity seeking information on the literal tokens __FILE__ and __LINE__. The camel book mentions them very briefly. What do they do and what possible use is there for them?

Replies are listed 'Best First'.
Re: Literal Tokens
by Masem (Monsignor) on Mar 15, 2001 at 01:21 UTC
    They are very useful in debugging programs as they will tell you the current file that is being interpreted (eg the perl file), and what line number you are currently at. If you have a custom die message for a module, you can mention "died at line " . __LINE__ . " in " . __FILE__ in order to convey as much info to the programmer.
    Dr. Michael K. Neylon - mneylon-pm@masemware.com || "You've left the lens cap of your mind on again, Pinky" - The Brain
      you can also get all this information and more from caller()...
      Thank you for your diagnosis, Doctor!