use Modules::Parse ('start_parser');
use strict;
my @resp = start_parser();
print @resp;
####
package Modules::Parse;
use Exporter;
@ISA = ('Exporter');
@EXPORT_OK = ('start_parser');
use strict;
use CGI;
use CGI::Carp qw(fatalsToBrowser set_message);
use CGI::Pretty qw(:standard);
#My Modules
use Modules::Htmlpage;
sub start_parser {
my @resp = ();
if (!param()){
push @resp, &Modules::Htmlpage::make_header("Hello first page.");
push @resp, &Modules::Htmlpage::make_first_page();
push @resp, param();
} elsif (param('get_in')){
push @resp, &Modules::Htmlpage::make_header("I say hello to you.");
push @resp, &Modules::Htmlpage::make_top_content("home");
push @resp, param();
} else{
push @resp, Modules::Htmlpage::make_header("There are params but not get_in.");
push @resp, Modules::Htmlpage::make_top_content("home");
push @resp, param();
}
push @resp, end_html;
return @resp;
}
1;
####
package Modules::Htmlpage;
use Exporter;
@ISA = ('Exporter');
@EXPORT_OK = ('make_header', 'make_first_page', 'make_top_content');
use strict;
use CGI::Carp qw(fatalsToBrowser set_message);
use CGI::Pretty qw(:standard);
my $path = '../images/mimgarea';
sub make_first_page {
my @resp = ();
push @resp,
start_form,
#method: POST
# action: this script
# enctype: application/x-www-form-urlencoded
table( {-border=>'0', -width => '950' , -align=>'center', -cellspacing=>"0", -cellpadding=>"0",},
Tr(
td( {-align=>'center',-width=>"50%"},
image_button( { -name => "get_in",
-title => "Enter hello",
-alt => 'ENTER',
-value=> "ENTER",
-src=>"$path/hello.gif"},
),
),
),
), endform;
return @resp;
}
sub make_header{
my @resp = ();
my $title = shift;
my $descript = "Hello page description.";
push @resp, header,
start_html( { -title => $title,
-meta => { 'keywords' => 'Hello, blabla',
'description' => "$descript" ,},
} ,
);
return (@resp);
}
sub make_top_content {
my $come_from = shift;
my @resp = ();
push @resp, table ({ -class=>'top', -width=> '950', -border=> "0", -cellpadding=> "0", -cellspacing=> "0", -align=> "center"},
Tr (
td ('Inside hello page.\n'),),
);
return (@resp);
}
1;
####
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, admin@yourhost.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
--------------------------------------------------------------------------------
Apache/2.0.48 (Win32) mod_perl/1.99_12 Perl/v5.8.3 Server at localhost Port 80
####