Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: How to find all the available functions in a file or methods in a module?

by JavaFan (Canon)
on Nov 11, 2008 at 08:30 UTC ( [id://722805]=note: print w/replies, xml ) Need Help??


in reply to How to find all the available functions in a file or methods in a module?

What other kind of code (besides string eval) can generate methods on the fly?
AUTOLOAD is both a well known generator of methods/functions as a simulator. You might not find a Foo->bar() method while searching the stash, but that doesn't mean you can't call 'bar' on Foo. AUTOLOAD may handle that; sometimes by installing a Foo::bar and then calling it or by just taking care of itself.

As for other ways beside string eval to generate methods, there's the assignment to the typeglob:

*{"Foo::bar"} = sub {print "Hello, world"};
or
*{"Foo::bar"} = \&{"Baz::quux"};
The latter is what typically happens at import time.

Log In?
Username:
Password:

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

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

    No recent polls found