For Programmers: Free Programming Magazines  


Home > Archive > PERL Miscellaneous > September 2004 > modifying scripts for mod_perl?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author modifying scripts for mod_perl?
Sergei Shelukhin

2004-09-28, 9:27 pm

I get variable error when I try to use procedure in a module to connect to
db.
=== common.pm
sub connect
{
return DBI->connect( "DBI:mysql:blogbase:localhost", "something",
"something" ) or croak "MySQL seems to be down.";
}
== index.pl
use common;
#...
$db = Common::connect() or croak "woops";

If I access it on my testbox running apache without mod_perl, it works.
If I type perl index.pl in console on the working server, it works.
When I try to access it on the server, with apache with mod_perl, it croaks.

What's the problem? How do I fix it? I seem to be pretty much out of any
clue...

I was also wondering if there's something like "HOWTO migrate to mod_perl"
guide somewhere.


Gunnar Hjalmarsson

2004-09-28, 9:27 pm

Sergei Shelukhin wrote:
> I was also wondering if there's something like "HOWTO migrate to
> mod_perl" guide somewhere.


There is: http://perl.apache.org/docs/1.0/guide/porting.html

--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com