Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Where can I find a complete reference for CGI.pm?

by KM (Priest)
on May 23, 2000 at 23:51 UTC ( #14432=note: print w/replies, xml ) Need Help??


in reply to Where can I find a complete reference for CGI.pm?

The CGI.pm documentation is pretty good, and shows some examples that should really show you everything you want to do. You could also look at the source to see what is going on. Lincoln also wrote a book, "Official Guide to Programming With Cgi.pm", ISBN 0471247448. It was done in 1998, so some things have been added to the module since then. But, except for the POD, what are you not understanding?

Cheers,
KM

  • Comment on Re: Where can I find a complete reference for CGI.pm?

Replies are listed 'Best First'.
RE: Re: Where can I find a complete reference for CGI.pm?
by perlmonkey (Hermit) on May 24, 2000 at 00:36 UTC
RE: Re: Where can I find a complete reference for CGI.pm?
by husker (Chaplain) on May 23, 2000 at 23:57 UTC
    Well there's an example of a Table object in the POD in CGI.pm, and it uses caption, td, Tr, etc. Are those all the other objects that can be used in a Table object? If not, what are the others? What "arguments" can td, Tr, etc, all take? Nowhere in the source for CGI.pm are references made to these "subobjects" to where I can see how they function, or what their scope is, etc. Unless I'm just missing it. I'm using 5.005, btw. Maybe 5.6 does a better job, I don't know. Updating to 5.6 is on my (long) list of things to do...
      When you are making a table, what do you use except for TD and TR? These methods (they are not objects) can take whatever params you want to give them, like:

      print td({-align=>'CENTER', -colspan=>2}, $data);

      Read the POD again, and experiment. You can nest the methods to create the HTML you want. If you want to see how they function, read the source code. I don't know what you are referring to for 'scope', since they are methods you import (or access via a CGI object).

      Cheers,
      KM

      Any named parameter not explicitly supported by CGI.pm's methods will be passed along as-is into the tag:
      chh@scallop chh> perl '-MCGI qw(:standard)' -le 'print td({-BOB => "fo +o", -CAT => "bar"}, "lala")' <TD BOB="foo" CAT="bar">lala</TD> chh@scallop chh>
      And you can always write the HTML yourself. I don't particularly like CGI.pm's HTML-generating methods.
      This is a bit of a repeat of KM's post but Tr and td are simply the table row and table data tags of HTML. Whatever options you can put in a table row tag or a table data tag you can put in Tr and/or td. As KM mentioned it will take whatever arguments you pass it. The beauty is that if a new attribute is added to one of those tags you simply add that attribute in the arguments list of Tr or td.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (7)
As of 2021-04-23 10:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?