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

Re: line number

by Molt (Chaplain)
on Sep 12, 2002 at 13:58 UTC ( [id://197224]=note: print w/replies, xml ) Need Help??


in reply to line number

It's all done by the caller function, do a perldoc -f caller to see how. The following is a quick demo..

#!/usr/bin/perl use strict; use warnings; test(); sub test { # Get info from the caller my ($package, $file, $line) = caller; print "Called from $line of $file in $package\n"; }

Log In?
Username:
Password:

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

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

    No recent polls found