First page Back Continue Last page Overview Graphics
CGI::Application module
use CGI::Application;
our @ISA = qw(CGI::Application);
sub setup {
my $self = shift;
$self->mode_param("rm");
$self->start_mode("graph_html");
$self->run_modes(graph_img => "graph_img",
graph_html => "graph_html",
);
}
sub graph_img {
my $self = shift;
my $cgi = $self->query();
my $legend = $self->param('legend');
....
....
return $output;
}
Notes:
C:A has a setup method which is used to define the default 'run mode' and each 'run mode' available to the current application.
A run mode is like a web page all on it's own.
By passing the 'rm=' tag as a CGI parameter, the web application can 'switch' between run modes.
Each 'run mode method' must 'return' it's output rather than print to standard output. This 'golden rule' of the C:A can be broken but should be adhered to wherever possible.