in reply to cgi.pm: complete list of method names?

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:
:cgi :form :html2 :html3 :internal :netscape Accept Area Delete Delete_all Dump HtmlBot HtmlTop Link MULTIPART Map Param PrintHeader ReadParse Select SplitParam Sub TR Tr URL_ENCODED Vars a address applet auth_type autoEscape b base basefont big blink blockquote body br button caption center cgi_error checkbox checkbox_group cite code comment content_type cookie dd defaults dfn div dl dt em embed end_form end_html end_multipart_form endform filefield font fontsize frame frameset h1 h2 h3 h4 h5 h6 head header hidden hr html http https i ilayer image_button img import_names input isindex kbd layer li menu meta multipart_end multipart_init multipart_start nextid ol option p param param_fetch password_field path_info path_translated popup_menu pre put query_string radio_group raw_cookie redirect referer remote_addr remote_host remote_ident remote_user request_method reset restore_parameters samp save_parameters script script_name scrolling_list self_url server_name server_port server_protocol server_software small span start_form start_html start_multipart_form startform strike strong style submit sup table td textarea textfield th title tmpFileName tt u ul upload uploadInfo url url_param use_named_parameters user_agent user_name var virtual_host
on my v2.56 CGI.

                - tye

Replies are listed 'Best First'.
Re: cgi.pm: complete list of method names? (easy)
by cLive ;-) (Prior) on Jul 16, 2003 at 12:34 UTC
    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