So there I was, trying to convert a few CGI scripts to work with a new site layout. I've installed Template Toolkit. I've set up Visual Source Safe. I've created a new directory structure to handle my templates. I've glanced through some of the code and seen some changes that need to be made. All is well. I tell my boss that it will only take a day to convert the first script. I thought it would only take a couple of hours, but I like to plan for surprises.
Rather than trying to make the changes, I start by verifying that the code I've copied actually functions.
'C:\Inetpub\test\www\cgi-bin\text.cgi' script produced no output
Oh, silly me. I forgot CGI::Carp qw/fatalsToBrowser/. Add that in.
'C:\Inetpub\test\www\cgi-bin\text.cgi' script produced no output
Well, let's see what the error log tells me.
*** 'C:\Inetpub\test\www\cgi-bin\text.cgi' error message at: 2001/06/2 +8 16:13:55 Can't locate GILib.pm in @INC (@INC contains:...
D'oh! I forgot to port over the modules. Boy, do I feel silly.
I VNC into the other server. (When did VNC become a verb?) I search for GILib.pm in D:\Perl\site\lib and D:\Perl\lib. That's odd, it's not there. I search the entire box.
There are 52 copies of GILib.pm on the server. Many of them have different sizes, telling me that these are many, many different versions. Seems the programmer puts a 'use lib ...' statement at the top of all of his code.
There is, fortunately, a bright side to this story. The programmer in question has decided to give up coding and make his living as a writer. Fortunately, he writes well, as long as it's prose.
Cheers,
Ovid
Update: Same program that wasn't working is now working fine (well, sorta). Discovered a little gem in the errant module. Seems the programmer didn't know how to do a proper redirect, so he wrote his own redirect function (which gets exported into my namespace!)
sub redirect { my ($newLoc) = @_; if (!($cookie)) { hTTPHeader() } print <<END; <html> <head> <script language="JavaScript"> function redirect() { document.location.href = '$newLoc'; } </script> </head> <body bgcolor=#000000 onLoad="redirect()"> </body> </html> END exitScript(); exit; }
Enjoy :)
Vote for paco!
Join the Perlmonks Setiathome Group or just click on the the link and check out our stats.
In reply to Multiplying modules :) by Ovid
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |