Automatic way to get a list of Perl functions?

Discussion in 'Perl Misc' started by El Duce, Oct 26, 2004.

  1. El Duce

    El Duce Guest

    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
     
    El Duce, Oct 26, 2004
    #1
    1. Advertising

  2. El Duce

    Uri Guttman Guest

    >>>>> "ED" == El Duce <> writes:

    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
     
    Uri Guttman, Oct 26, 2004
    #2
    1. Advertising

  3. El Duce

    El Duce Guest

    Uri Guttman wrote:
    >>>>>>"ED" == El Duce <> writes:

    >
    >
    > 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
     
    El Duce, Oct 26, 2004
    #3
  4. El Duce <> wrote:

    > 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'


    --
    Tad McClellan SGML consulting
    Perl programming
    Fort Worth, Texas
     
    Tad McClellan, Oct 26, 2004
    #4
  5. El Duce wrote:
    > 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
    --
    use Perl;
    program
    fulfillment
     
    John W. Krahn, Oct 27, 2004
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Guest
    Replies:
    1
    Views:
    790
    Guest
    Jun 29, 2004
  2. Xiangliang Meng
    Replies:
    1
    Views:
    1,659
    Victor Bazarov
    Jun 21, 2004
  3. Ross A. Finlayson
    Replies:
    19
    Views:
    650
    Keith Thompson
    Mar 10, 2005
  4. Replies:
    2
    Views:
    308
  5. Meph
    Replies:
    2
    Views:
    263
    Barry
    Jan 22, 2008
Loading...

Share This Page