Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

where from function is called(line,name) 2

Status
Not open for further replies.

sneg86

Programmer
Jan 28, 2004
8
RU
I make a simple module but fucnions in it should know where from they are called - file name and line in the file. Is it possible?? and how?? thanks in advance..
 
[tt]my ($package, $filename, $line) = caller;[/tt]

After that statement [tt]$filename[/tt] and [tt]$line[/tt] will have what you're looking for.
 
That's one of those things I needed once but never found. Thanks rosenk. Always learning. :)

________________________________________
Andrew - Perl Monkey
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top