Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Weird perl error on new server. 1

Status
Not open for further replies.

LucL

Programmer
Joined
Jan 23, 2006
Messages
117
Location
US
I just got a new server and everytime I run a script that ran fine on my old machine I get this error:

Undefined subroutine &ModPerl::ROOT::ModPerl::Registry::var_
The sub is "load_settings" called as "&load_settings". The weird thing is, after I click refresh page once or twice it loads up just fine.

load_settings is a subroutine in a "required" module that handles loading some required settings for the script..

use CGI qw(:standard);
use CGI::Carp qw( fatalsToBrowser );

$root_path='/home/httpd/vhosts/somedomain.com/';

require $root_path . 'cgi-bin/generic_subs.lib';

&load_settings();

$query = new CGI;
print $query->header();

It seems to work fine after I refresh the page once or twice but that's not how it should work.

Any ideas?
 
Btw. it always works fine when ran from the shell.

Also, when I restart apache it works fine, then I guess after it creates multiple sessions it starts to screw up.

This is running ModPerl
 
Is there a minimum revision of mod_perl that supports it? Are the settings the same as your old server?

Paul
------------------------------------
Spend an hour a week on CPAN, helps cure all known programming ailments ;-)
 
Paul,

I figured out the error is caused by mod_perl name collision.

Replacing require with do solves that problem.

Best Regards,
Luc L.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top