#!/usr/bin/perl -w use strict; use CGI; use My::App; my $cgi = CGI->new(); my $mode; if( $cgi->param( 'page' ) { $mode = $cgi->param( 'page' ); } elsif( $cgi->param( 'stats' ) ) { $mode = "stats"; } elsif( $cgi->param( 'new' ) ) { $mode = "new"; } else { $mode = "some_default"; } my $app = My::App->new(); $app->start_mode( $mode ); $app->run();