in reply to use CGI and die;

You forgot to mention the sticky form values. It is immensely useful to be able to insert a form element into a template and have it just work correctly without lots of template-side gyrations. In fact, I'd say this is the proper way to use things like CGI::Application and HTML::Template.

sub fizzbinbox { my $self = shift; my $tmpl = $self->load_tmpl; my $q = $self->query; $tmpl->param( fizzbin => $q->checkbox_group( -name => 'words', -values=>['eenie','meenie','minie','moe'], -defaults=>['eenie','minie']) ); return \ $tmpl -> output; }

Replies are listed 'Best First'.
(wil) Re: Re: use CGI and die;
by wil (Priest) on Jun 10, 2003 at 19:25 UTC
    I'll upvote you and reply here. If you have *ever*, ever, ever found yourself writing something like:

    if ($query->param('foo') eq "bar") { do this } elsif ($query->param('foo') eq "mynameisdave") { do something completly stupid } else { ...

    Then *STOP* now and start using CGI::Application. It's the best thing since nutella on that thick bread your mum used to make and should be used at all times for any CGI application that used multiple form, pages, or any other kind of multiple foo application.

    Try it, then slate me for saying it if you don't like it. But you like that nutella, so come on, I must be right, right?

    Over and out.

    - wil