Hi Foxcub. Personally, i don't think CGI::Application is overkill for this at all (well ... maybe just a tad). If Coruscate will allow me to lift some code:
#!/usr/bin/perl -T package WebApp; use strict; use warnings; use base qw(CGI::Application); use CGI qw(:standard); sub setup { my ($self) = @_; $self->start_mode('main'); $self->mode_param('q'); $self->run_modes( main => 'main', login => 'login', members => 'members', AUTOLOAD => '_invalid', ); } sub main { return start_html('Welcome') . p( strong('Welcome to my website!') ) . end_html() ; } sub login { return start_html('Member Login') . p( strong('Member Login') ) . p('Login below:') . end_html() ; } sub members { return start_html('I am a member-only page!') . p( strong('Members Page') ) . end_html() ; } sub _invalid { return start_html('Invalid Function') . p( strong('Invalid Script Function') ) . p('That fucntion is not valid!') . end_html() ; } package main; use strict; use warnings; my $webapp = WebApp->new(); $webapp->run();
I actually find CGI::App to be more elegant than a dispatch table, and for the record, i have only recently discoverd CGI::App. I used dispatch tables plenty in the past. In essence, CGI::App is a dispatch table, but one that is tested and ready to go.

jeffa

L-LL-L--L-LL-L--L-LL-L--
-R--R-RR-R--R-RR-R--R-RR
B--B--B--B--B--B--B--B--
H---H---H---H---H---H---
(the triplet paradiddle with high-hat)

In reply to (jeffa) Re: Event Handling in CGI by jeffa
in thread Event Handling in CGI by Tanalis

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.