--0016364d22e5a5a5c6048ccd0480
Content-Type: text/plain; charset=ISO-8859-1
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
--0016364d22e5a5a5c6048ccd0480
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Hi,<br><br>I'm relatively new to perl so bear with me please. I'm s=
eeing a strange behavior with perl<br><br>When I use the following config i=
n apache<br><br><VirtualHost *:80><br>=A0 ServerName perly<br>=A0 Doc=
umentRoot /var/www/perl/perly<br>
<br>=A0 <Directory /var/www/perl/perly><br>=A0=A0=A0 AddHandler perl-=
script .pl<br>=A0=A0=A0 PerlOptions ParseHeaders<br>=A0=A0=A0 PerlHandler M=
odPerl::Registry<br>=A0=A0=A0 PerlSendHeader On <br>=A0=A0=A0 Options Index=
es ExecCGI<br>=A0=A0=A0 AllowOverride All<br>
=A0=A0=A0 Order allow,deny<br>=A0=A0=A0 Allow from All<br>=A0 </Director=
y><br></VirtualHost><br><br>The following code<br>#!/usr/bin/perl =
-w<br>use strict;<br>use warnings;<br>use DBI;<br>use Cwd;<br>use CGI::Pret=
ty qw(:standard);<br>
<br>my %config =3D (<br>=A0=A0=A0 host=A0=A0=A0=A0 =3D> 'localhost=
39;,<br>=A0=A0=A0 database =3D> 'perly',<br>=A0=A0=A0 username =
=3D> 'root',<br>=A0=A0=A0 password =3D> ''<br>);<br><=
br>my $dbh =3D DBI->connect("dbi:mysql:".$config{'database=
'}, $config{'username'}, $config{'password'});<br>
<br>print header,<br>start_html(-title=A0=A0 =3D>=A0 'Please Login=
39;,<br>=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 -base=A0=A0 =3D>=A0 'true&=
#39;,<br>=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 -target =3D>=A0 '_blank=
39;,<br>=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 -meta=A0=A0 =3D>=A0 {'keyw=
ords'=A0=A0=A0=A0 =3D>=A0 'login',<br>
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 =A0=A0=A0=A0 =
39;description'=A0 =3D>=A0 'This is the login screen'},<br>=
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 -style=A0 =3D>=A0 {'src'=3D>=
;'/styles/style1.css'} );<br>require("/var/www/perl/perly/<a h=
ref=3D"http://login.pl">login.pl</a>");<br>
print end_html;<br>print "\n";<br><br>The <a href=3D"http://login=
..pl">login.pl</a> file gets executed only once. Upon subsequent refreshes i=
t dissapears.<br>If I have AddHandler cgi-script .pl above, the script work=
s fine.<br>
<br>Can someone please help me fix this issue?<br><br>Thanks,<br><br>Roland=
<br><br><br>
--0016364d22e5a5a5c6048ccd0480--
