Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
This code works just fine on my platform from both the command line and my browser. Those of you who have read the CGI Programming book should recognize the code.
Anyway, here's the code:
#!/usr/bin/perl -wT
use strict;
use CGI::Carp qw(fatalsToBrowser);
use CGI;
my $q = new CGI;
#line 5#
print $q->header( "text/plain" );
print "These are the HTTP Environment variables that I got.\n\n";
foreach ($q->http ) {
print "$_\n";
print " ". $q->http( $_ ), "\n";
}
However, when I uploaded this to another site, it wouldn't work and here's what I got in the server log:
Too late for "-T" option at expermint.cgi line 1. Could not fire up expermint.cgi
I have several other scripts at that site that generate the same errors when I leave the -T mode on. I uploaded this script to the other site because I was certain it was not my code that was generating this error.
The tech people at that site said that they were unable to get the code to work even with the -T on off thus implying there is something wrong with the above code itself.
So I uploaded it to another site and I was able to get it work.
So then I decide to leave off the -T and got some unexpected output along with the expected output:
<Iframe ><html_code><annoying_ad.png ></html_code ></iframe>
The rest of the output was as expected.
As soon as I saw the unexpected html, I realized why I had been getting the errors with the -T on.
It so happens that my account is free and in order for me to keep the account, I have to accept ads on both my webpages and my cgi scripts. I'm certain that the ads are the reason behind my errors. There is no way my scripts could untaint that!
Now, I must admit here that I'm no computer or Perl guru and it is possible that the code itself is faulty and I want to know if there are other reasons why I keep getting this error?
However, there is no reason why all of my scripts should generate the same error - especially when one of my scripts doesn't depend on input from my web browser.Any input would be much appreciated. Sorry for the long post.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Too late for "-T" option
by Errto (Vicar) on Oct 10, 2004 at 00:22 UTC | |
|
Re: Too late for "-T" option
by tachyon (Chancellor) on Oct 10, 2004 at 02:59 UTC | |
by Anonymous Monk on Oct 11, 2004 at 02:21 UTC | |
by Anonymous Monk on Oct 11, 2004 at 03:03 UTC | |
by Anonymous Monk on Oct 13, 2004 at 23:31 UTC | |
|
Re: Too late for "-T" option
by hsinclai (Deacon) on Oct 10, 2004 at 00:49 UTC |