phani_va has asked for the wisdom of the Perl Monks concerning the following question:

hi Iám looking for a complete listing of all the methods in the CGI.pm module.From the online documentation I can only find description about specific methods.can anybody tell where I can get a complete listing of all the methods available in CGI module

thanx
phani

Edit by tye, title, preserve breaks

Replies are listed 'Best First'.
Re^1: cgi.pm: complete list of method names? (easy)
by tye (Sage) on Jul 15, 2003 at 22:44 UTC

    Simply look at %CGI::EXPORT_TAGS.

    use CGI; my %hash; @hash{ @{$CGI::EXPORT_TAGS{$_}} }= () for keys %CGI::EXPORT_TAGS; my @methods= sort keys %hash; print join "\n", @methods, ""; __END__
    which produces: on my v2.56 CGI.

                    - tye
      Nice one tye, but you missed the methods created by AUTOLOAD.

      So I suggest you look at the CGI.pm source as well, particularly the _compile sub and, by inference, the _make_tag_func sub. As far as I can see, the tags you can generate depend on the DTD you are using (ie HTML or XHTML). For when you use tags like this:

      my $q = CGI->new(); my $start_tr = $q->start_Tr().$q->start_td();

      etc...

      cLive ;-)

        I did look at the source. The idea to look at %EXPORT_TAGS came from the fact that AUTOLOAD looks at %EXPORT_TAGS to decide whether the method called should be created or not (unless you asked it to allow you to create just any method).

        There are some methods that aren't created via AUTOLOAD but those are in %EXPORT_TAGS already.

        Yes, the special handling of "start" and "end" prefixes isn't covered by this simple trick. There are probably a few other edge cases as well.

                        - tye
(jeffa) Re: cgi.pm
by jeffa (Bishop) on Jul 15, 2003 at 21:58 UTC
Re: cgi.pm
by thewalledcity (Friar) on Jul 15, 2003 at 21:53 UTC
    Try looking at Perldoc or you could try browsing through the source of the module. And of course there is always Ovid's CGI course.
      I tried perldoc and other resources.is there any other way other than browsing throught the source code to take a look at the all the available methods