Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

RE: RE: I use CGI.pm for

by merlyn (Sage)
on Jun 08, 2000 at 04:51 UTC ( #16997=note: print w/ replies, xml ) Need Help??


in reply to RE: I use CGI.pm for
in thread I use CGI.pm for

Thus saith royalanjr:

Call me crazy, but I generally do not let CGI.pm do my HTML. I prefer to write that out myself. Being new, I know I have not explored all its possibilies yet though. I do use it to pass my parameters around.
Once you discover the sticky fields technology of web form generation, you'll never go back. CGI.pm rules!

-- Randal L. Schwartz, Perl hacker


Comment on RE: RE: I use CGI.pm for
RE: RE: RE: I use CGI.pm for
by chromatic (Archbishop) on Jun 08, 2000 at 05:03 UTC
    I've run into a case where CGI.pm was a little too sticky. Still, it's really a good way to go, as you don't have to worry about updating code in a script somewhere when the HTML specification changes.

    Has anyone tried the 3.0 alpha versions? They're supposed to be much smaller and much, much faster.

      I agree. Sometimes the stickiness make a script to behave strange, especially if you have a muliple page form generation / evaluation script with hidden fields.
      There is a good idea to try the 'override' flag on hidden fields if such a script behaves strange.

      /Wonko

RE: RE: RE: I use CGI.pm for
by cwest (Friar) on Jun 08, 2000 at 06:11 UTC
    Not to mention, with some creative map use, you can create dynamic tables and such pretty easy, while not breaking the stylish print 'some','things','in','a','row'; :-)
    use CGI;
    my $cgi = CGI->new;
    print $cgi->header,
          $cgi->start_html('Times Tables'),
          $cgi->table( { -border => 1 },
                     ( map {
                      my $r = $_;
                      $cgi->Tr( ( map {
                               $cgi->td( $_ * $r ),
                              } 1 .. 50 ) ),
                     } 1..50 ) ),
          $cgi->end_html;
    
    And for the obfuscated lovers in all of us (some people would call the above obfuscated.. slackers:-)
    use CGI;my$cgi=CGI->new;print##
    $cgi->header=>$cgi->start_html#
    ('Times Tables')=>$cgi->table(#
    {-border=>1}=>(map{my$r=$_;$cgi
    ->Tr((map{$cgi->td($_*$r)}1..50
    ))=>}1..50))=>$cgi->end_html;##
    
    --
    Casey
    
RE: RE: RE: I use CGI.pm for
by royalanjr (Chaplain) on Jun 08, 2000 at 17:15 UTC

    Sticky Fields?!?

    *pulling at my hair in despair, dropping to my knees*

    So much to learn!!!

    Roy Alan

    "I quit; I concede. Tanj on your silly game!" -- Louis Wu

      Sticky fields is a CGI.pm facility which is useful when you have a CGI script which returns multiple forms; The script automatically fills in the old formfield data (i.e. the data that has already been posted)
      This is wery useful if you want to keep track of the information the user has already entered in hidden fields, or if you have to resend a form because the user did something wrong
      /wonko

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (11)
As of 2014-10-23 21:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (129 votes), past polls