CGI Application Modules for CPAN
Listing 11 1. BBS.pm, the CGI::Application BBS
package BBS;
use CGI::Application;
@ISA = qw(CGI::Application);
sub setup {
my $self = shift;
$self >mode_param("rm");
$self >start_mode("list");
$self >run_modes(list => "list",
save => "save",
new => "new_message",
read => "read",
reply => "reply",
search => "search");
}
# show list of messages
sub list {
my $self = shift;
my $query = $self >query();
my $output;
# ...
return $output;
}
# save the message, then switch to list mode
sub save {
my $self = shift;
my $query = $self >query();
# ...
return $self >list();
}
# run a search and show the results
sub search {
my $self = shift;
my $query = $self >query();
my $output;
# ...
return $output;
}
25
259
9
footer
Our partners:
PHP: Hypertext Preprocessor Best Web Hosting
Java Web Hosting
Inexpensive Web Hosting
Jsp Web Hosting
Cheapest Web Hosting
Jsp Hosting
Cheap Hosting
Visionwebhosting.net Business web hosting division of Web
Design Plus. All rights reserved