Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Re: Module Subs and Methods

by Arguile (Hermit)
on Jun 19, 2003 at 21:50 UTC ( #267364=note: print w/ replies, xml ) Need Help??


in reply to Re: Module Subs and Methods
in thread Module Subs and Methods

The list should include all the subs the compiler knows about just prior to running the program. The program will not be run.**

That's a very important distinction, as nothing dynamic (ie. run-time evaluated) will be listed.

For example, CGI is probably the most well known example of dynamic autoloading. If you were to use CGI in your program and then run this, you’d see only a very small selection of the function available. However with use CGI qw(-compile :all) it would list them all. That's because, by default, CGI only compiles a function when it’s requested.

Update: A simpler example is require Module::Name if $foo

Any method to list functions will always be suspect due to dynamic evaluation. Add in anonymous subs and the waters are even murkier. This isn't a failing in BrowserUK’s method (which is pretty damn cool), it’s a reality of Perl.


** Not completely correct as the BEGIN{} block will be run. (Yes I’m picking nits :)


Comment on Re: Re: Module Subs and Methods
Select or Download Code
Re: Re: Re: Module Subs and Methods
by Anonymous Monk on Jun 19, 2003 at 21:56 UTC

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (13)
As of 2014-08-20 17:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (120 votes), past polls