Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: a list of functions within a pm

by TheoPetersen (Priest)
on Jul 19, 2001 at 23:09 UTC ( #98194=note: print w/ replies, xml ) Need Help??


in reply to a list of functions within a pm

If your package only contains subs (no package variables), you can just use the package's symbol table:

package foo; sub one { return 1 }; sub two { return 2 }; sub subs { no strict; return keys %foo::; }
You'll also get a BEGIN entry (at least, with 5.6.1 I did).


Comment on Re: a list of functions within a pm
Download Code
Re: Re: a list of functions within a pm
by Tyke (Pilgrim) on Jul 20, 2001 at 14:48 UTC
    There's no guarantee that methods for that package have been defined outside the .pm file. There's also no guarantee that the .pm file doesn't contain more than one package. Granted both are less than elegant, but still possible.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (10)
As of 2014-12-22 23:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (133 votes), past polls