Hi,
I'm relatively new to perl so bear with me please. I'm seeing a strange
behavior with perl
When I use the following config in apache
<VirtualHost *:80>
ServerName perly
DocumentRoot /var/www/perl/perly
<Directory /var/www/perl/perly>
AddHandler perl-script .pl
PerlOptions ParseHeaders
PerlHandler ModPerl::Registry
PerlSendHeader On
Options Indexes ExecCGI
AllowOverride All
Order allow,deny
Allow from All
</Directory>
</VirtualHost>
The following code
#!/usr/bin/perl -w
use strict;
use warnings;
use DBI;
use Cwd;
use CGI::Pretty qw(:standard);
my %config = (
host => 'localhost',
database => 'perly',
username => 'root',
password => ''
);
my $dbh = DBI->connect("dbi:mysql:".$config{'database'},
$config{'username'}, $config{'password'});
print header,
start_html(-title => 'Please Login',
-base => 'true',
-target => '_blank',
-meta => {'keywords' => 'login',
'description' => 'This is the login screen'},
-style => {'src'=>'/styles/style1.css'} );
require("/var/www/perl/perly/login.pl");
print end_html;
print "\n";
The login.pl file gets executed only once. Upon subsequent refreshes it
dissapears.
If I have AddHandler cgi-script .pl above, the script works fine.
Can someone please help me fix this issue?
Thanks,
Roland