Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

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 :)

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 all is quiet...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (4)
As of 2018-03-18 06:51 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (228 votes). Check out past polls.