I have gone ahead and moved the script entirely over to mod perl using apache::registry and seting PerlWarn to on. I have repaired the initial errors and problems that occured and am glad to say that I have my first mod_perl script totally up and running. I have not had any errors as of lately(fingers crossed). Everything seems to be running fine. Thanks John michael
----- Original Message ----- From: "Perrin Harkins" <[EMAIL PROTECTED]> To: "John Michael" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Wednesday, October 24, 2001 2:31 AM Subject: Re: Newbie having problems > > John Michael wrote: > > I am attempting first to ge them to run correctly under. > > Apache::PerlRum > > Be careful of PerlRum! It will give you a wicked hangover! > > PerlRun is a quick way to port dirty scripts that you can't take the > time to fix. It's the slowest way to run anything in mod_perl, but if > your script uses lots of globals, imports functions all over the place, > etc. you may have no choice. > > > I had a routine in the beginning of the program to initialze my variable hash and query param like so: > > ###### initialize globals ###################### > > foreach (keys %VAR){$VAR{$_} = "";} > > > > I did this so that these variables would not propogate to other instances of the script. > > This was causing the error. > > > > I removed it and added a this small sub: > > sub clean_up { > > undef %VAR; > > Apache::exit(); > > } > > > > Is this the correct way to do this or even necessary? > > It should not be necessary. Unless you have delcared these to be in a > separate package, PerlRun will clean them up after every request. Are > you declaring a package in your script? > > > The Apache::exit() function is still causing an error, but the script runs and works but is evidently not exiting gracefully. > > Why are you needing to exit? Maybe this is something that you can > avoid, and improve performance. > > > Also, I am running the script in an eval{ } block in order to trap errors in the $@ variable. > > IS this ok practice in mod-perl? > > The entire script is in an eval block? You can do that, but if all you > want is a decent page when something fails, just put up your nice page > and set it up as the SERVER ERROR page in httpd.conf. > > > The scripts run, but sometimes through server errors. > > I am getting the following errors. > > > > [Tue Oct 23 06:57:27 2001] [error] PerlRun: `Not a CODE reference at > > /home/usr1/digital/membersurl/perl/content_manager/handler.pl line > > 57.' > > > > [Tue Oct 23 06:57:27 2001] [error] Can't locate object method "uri" > > via package "Apache::PerlRun" at > > /usr/lib/perl5/site_perl/5.6.0/i386-linux/Apache/PerlRun.pm line 212. > > Things like this are usually the result of using libraries that don't > declare package names. Do you pull in a bunch of functions with > something like 'use mylib.pl' with no package names declared in > mylib.pl? There is more discussion about this in the guide. In fact, > all of this is in the guide. > > - Perrin