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

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.