Automatic way to get a list of Perl functions?

E

El Duce

Is there a way to automatically generate a list of valid Perl functions?
I know how to query for modules, but short of fetching and trying to
parse the output of "perldoc perlfunc," does anyone know a way?

I also saw Pod::Tree, and this may do the trick, but how can I portably
get the path my Perl uses for the documentation? There's another useful
looking module, but it requires the path, and isn't well documented.

TIA,
El Duce
 
U

Uri Guttman

ED> Is there a way to automatically generate a list of valid Perl
ED> functions? I know how to query for modules, but short of fetching and
ED> trying to parse the output of "perldoc perlfunc," does anyone know a
ED> way?

why?

perldoc perlfunc lists them all. grep it

uri
 
E

El Duce

Uri said:
ED> Is there a way to automatically generate a list of valid Perl
ED> functions? I know how to query for modules, but short of fetching and
ED> trying to parse the output of "perldoc perlfunc," does anyone know a
ED> way?

why?

perldoc perlfunc lists them all. grep it

uri

I wanted to make a list for display on a CGI page (with doc links). I
didn't want to parse perlfunc, since that depends upon the doc format
not changing much.

I'm not merely trying to find the name of a function.

-El Duce
 
T

Tad McClellan

El Duce said:
Is there a way to automatically generate a list of valid Perl functions?

perl -ne 'BEGIN{@ARGV=`perldoc -l perlfunc`} print "$1\n" if /=item (\w+)/ and not $seen{$1}++'

or

perl -ne 'print "$1\n" if /=item (\w+)/ and not $seen{$1}++' `perldoc -l perlfunc`

short of fetching and trying to
parse the output of "perldoc perlfunc,"


Oh, nevermind then.

how can I portably
get the path my Perl uses for the documentation?


perl -e 'print "$_\n" for @INC'
 
J

John W. Krahn

El said:
Is there a way to automatically generate a list of valid Perl functions?
I know how to query for modules, but short of fetching and trying to
parse the output of "perldoc perlfunc," does anyone know a way?


$ perldoc perlfunc 2> /dev/null | perl -lne'
@func{ grep [ s!/.+!! ], m!"([a-zA-Z/]+)"!g } = ()
if /Perl Functions by Category/ .. /Alphabetical Listing of Perl Functions/
} { print for sort keys %func '



John
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top