Hi,lists,
I am new to mod_perl.I have a simple mod_perl script running under
Apache::Register.When it run,I found many error messages appeared in
logs/error_log.
The program is shown below:
use strict;
use warnings;
use CGI;
use CGI::Cookie;
use vars qw($q $sessionID);
$q = new CGI;
init();
print_header();
print_verify();
### <-- subroutines --> ###
###########
sub init{
$sessionID = generate_sessionID();
}
#################
sub print_header{
my $c = CGI::Cookie->new
('-name' => 'graySessionID',
'-value' => $sessionID,
'-expires' => '+1h');
print $q->header
(-type => 'text/html',
-cookie => $c);
}
#################
sub print_verify{
print qq{<HTML><HEAD><TITLE>Something test</TITLE></HEAD><BODY
bgcolor=\"\#eee2b5\">};
print <<EOF;
<p>Input password:</p>
<form method="POST" action="/perl/verify.pl">
<p><input type="password" name="passwd" size="20">
<input type="submit" value="submit" name="submit"></p>
</form>
EOF
print qq{</BODY></HTML>};
}
########################
sub generate_sessionID {
return scalar localtime;
}
The error messages in error_log are shown below:
########################
sub generate_sessionID {
return scalar localtime;
}
}
;' called at
/usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/Apache/Registry.pm line
183
Apache::Registry::compile('package Apache::ROOT::perl::login_2epl;use
Apache qw(exit);su...') called at
/usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/Apache/Registry.pm line
134
Apache::Registry::handler('Apache=SCALAR(0x863ae64)') called at
/home/apache1.3/perl/login.pl line 26
eval {...} called at /home/apache1.3/perl/login.pl line 26
Subroutine print_verify redefined at /home/apache1.3/perl/login.pl line 42.
eval 'F;
print qq{</BODY></HTML>};
}
########################
sub generate_sessionID {
return scalar localtime;
}
}
;' called at
/usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/Apache/Registry.pm line
183
Apache::Registry::compile('package Apache::ROOT::perl::login_2epl;use
Apache qw(exit);su...') called at
/usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/Apache/Registry.pm line
134
Apache::Registry::handler('Apache=SCALAR(0x863ae64)') called at
/home/apache1.3/perl/login.pl line 42
eval {...} called at /home/apache1.3/perl/login.pl line 42
Subroutine generate_sessionID redefined at /home/apache1.3/perl/login.pl line
60.
eval 'F;
print qq{</BODY></HTML>};
}
########################
sub generate_sessionID {
return scalar localtime;
}
}
;' called at
/usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/Apache/Registry.pm line
183
Apache::Registry::compile('package Apache::ROOT::perl::login_2epl;use
Apache qw(exit);su...') called at
/usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/Apache/Registry.pm line
134
Apache::Registry::handler('Apache=SCALAR(0x863ae64)') called at
/home/apache1.3/perl/login.pl line 60
eval {...} called at /home/apache1.3/perl/login.pl line 60
Can anyone here tell me what this happen?and how can I adjust it? Thanks.
_______________________________________________________________
Halloween Humour: What was the vampire doing on the highway?
postmaster.co.uk
http://www.postmaster.co.uk/cgi-bin/meme/quiz.pl?id=133