Determining which module exported a specific function.

S

Sisyphus

Hi,

Let's say I'm working through a script, trying to diagnose a problem,
and there's a function foo() that I don't know much about. I wish to
consult the documentation on foo(), but I don't know which of the 20
loaded modules exported it. I know 'foo' is in @EXPORT_OK of one of
those 20 modules - but I don't know *which* module.

How can I determine quickly and easily which module's documentation I
need to consult ?

Or, to rephrase, how can I quickly determine an imported function's
fully qualified package name.

Cheers,
Rob
 
M

Martin Kissner

Sisyphus wrote :
Hi,


How can I determine quickly and easily which module's documentation I
need to consult ?

Or, to rephrase, how can I quickly determine an imported function's
fully qualified package name.
I don't know, if Perl supportes any help for this.
Otherwise you could use grep.
grep -r foo() /path/to/perlmodules

HTH
 
A

Anno Siegel

[...]
Or, to rephrase, how can I quickly determine an imported function's
fully qualified package name.

use Devel::peek 'CvGV';
print CvGV( \ &imported_from_somewhere), "\n";

Anno
 
B

Brian McCauley

Sisyphus said:
how can I quickly determine an imported function's
fully qualified package name.

B::svref_2object(\&an_imported_function)->GV->STASH->NAME
 
M

Michele Dondi

use Devel::peek 'CvGV';
print CvGV( \ &imported_from_somewhere), "\n";

B::svref_2object(\&an_imported_function)->GV->STASH->NAME

Wow!!

And think that I was trying my hand at this, wandering through the
symbol table...


Michele
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top