Click here to get back home

Where was a function defined?

 HomeNewsGroups | Search | About
 comp.lang.perl.misc    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
Where was a function defined? Daniel Pfeiffer 09-02-2006
Posted by Daniel Pfeiffer on September 2, 2006, 6:39 pm
Please log in for more thread options
Hi,

with "caller" I can pinpoint where something comes from. Question is how can
I get at that same information _without_ calling the function?

Usage is in the "make" improvement makepp.sf.net, where a rule action can be a
self defined function as in

sub c_mycommand { ... }        # c_ marks this as a command

targets: dependencies
        &mycommand args

Now that function might be defined in the same makefile, in an include file,
or in a module which gets use`d. (In the first two cases it goes through an
eval with a #line nnn "file" directive so perl knows where it came from.)

Since makepp tries very hard to guarantee correct builds, it makes this
function an implicit dependency. But currently that dependency is the
makefile -- which is wrong if it came from include or use.

I hope there is an easier way than traversing %:: and hunting for a function
of the same name!

thanks in advance!
Daniel

Similar ThreadsPosted
Question on "defined" function February 22, 2006, 10:38 am
problem in passing parameters in function defined in perl module June 29, 2005, 7:28 pm
short form for (defined $x and defined $y and ... )? March 25, 2006, 12:14 am
Where is EOM defined? August 16, 2005, 1:01 pm
Where are Inline_Stack_Vars, etc. defined? July 30, 2005, 7:36 am
not defined v. eq undef January 25, 2008, 4:19 am
Shortcut for if(defined($var) && $var ne "") ? April 6, 2008, 2:53 am
How can I find out where a subroutine is defined? September 29, 2004, 8:48 pm
SysV constants, where are they defined? November 17, 2004, 10:16 am
Example for User-defined subroutines for GetOptions please June 24, 2005, 9:51 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap