Re[4]: [Xitami] Re: ActivePerl & Xitami - CGI problems Continued

Paul Reid xitami@lists.xitami.org
Wed, 25 Sep 2002 11:37:59 -0400


> There are obvious typos.

Mine too. (I fixed them while composing the message but failed to
re-load the changed attachment).

> don't know if attachments are "allowed" here,

There are "issues", so we try to use them carefully or Ewen will
turn off attachments. Such as: on another list, someone sent a SEVEN
MEG attachment (patch file) to a list where 98% of the readers
didn't need the patch. Nearly melted my modem. Executable
attachments are an ongoing problem, and these modern mail-readers
seem to know how to execute about anything without informed consent
from the recipient. And some old grumps (I'm one) aren't real keen
about duplicating the text as pretty-color HTML, or worse: that
wretched encoding that some old OutLooks attached to every email.

But I felt that 2K of example code wasn't too onerous even on modem,
and I tried to make it look like Plain Text so no foolish mail
client would "helpfully" try to Run it.

> ******************* Lesson Learned! ********************

This bears repeating repeating repeating repeating repeating...

> ******************* Lesson Learned! ********************

> Never, never test scripts without:

> use CGI::Carp qw(fatalsToBrowser);

> in them!!!!! (Sticks your nose right in the problem)

> ******************* Lesson Learned! ********************

NEVER, NEVER TEST Perl CGI SCRIPTS WITHOUT:
 1) use CGI::Carp qw(fatalsToBrowser);
 2) running with the " -w" option
 3) use Strict;

I am not sure if " -w" (warn) can be forced in the shebang line. It
may need to be set globally in Xitami's Filters setting. Even there,
it may not propagate in all versions of O/S, Perl, and Xitami. So
run the script with -w from a command-line before you finish
testing. While there may be extra errors because it isn't called
with all CGI parameters on hand, you should be able to account for
them. Turning off -w "usually" means there is something wrong with
the script, and any apparent success is dumb luck.

 -PRR