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

Re: At which line number did the print statement occure?

by mrpeabody (Friar)
on Oct 14, 2006 at 05:29 UTC ( [id://578253]=note: print w/replies, xml ) Need Help??


in reply to At which line number did the print statement occure?

__LINE__ and friends should be documented in perlvar as well as perldata. perlvar is the logical place to look for this functionality.

Replies are listed 'Best First'.
Re^2: At which line number did the print statement occure?
by jrockway (Acolyte) on Oct 16, 2006 at 02:42 UTC
    They're data, not variables. (Vary as in change.) Plus, they look a lot like __DATA__ and __END__, which are documented in perldata.
      It's worth noting that the function caller, when used in Windows, returns the line from the first line of actual code.

      #! /usr/bin/perl -w foo() ; sub foo{ print join(" ", caller); }
      This will print '3' as the line number on my Windows machine.
      Bro. Doug :wq

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (7)
As of 2024-03-29 08:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found