Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked

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
Replies are listed 'Best First'.
Re: Re: Re: Module Subs and Methods
by Anonymous Monk on Jun 19, 2003 at 21:56 UTC

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (7)
As of 2015-11-27 11:26 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (725 votes), past polls