Learning CGI::Application - my first effort

davebaker on 2005-02-19T21:55:59

I've been learning how to use CGI::Application. I took an example from Apache::ASP and reworked it into the CGI::Application way of doing things. I think I like it better.

I added the example to the CGI::Application kwiki at http://twiki.med.yale.edu/twiki2/bin/view/CGIapp/ColorChooserExampleApp


What I use

GAVollink on 2005-02-22T21:24:46

Now that I have a basis for your question, I think this will be sufficient...

Typically I do this:

use CGI qw/:all/;
use DBI;
use DBD::Oracle;
I program using a state engine, and hidden tags...
sub action()
{
  my ( $act ) = @_;

  if ( $act eq '' )
  {
    &present_menu();
  }
  elsif ( $act =~ m/^ed/ )
  {
    # get auxillary parms for this action...
    &do_edit();
  }
  # etc, etc...
}