wow the darn thing works! Hey Ovid, is it ok if I add your name to the list
of contributers to my script? I'll also let you look at the script if you
want too....hell I'll let you see it in action at my website if you want to!

The lines that i needed were:

my $q = CGI->new("");

print $q->header(-type=>'text/html',
                        -status=>'204 No Response');

That's it! Wow my first real program at 16...I feel special!

-----Original Message-----
From: Curtis Poe [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, June 26, 2001 2:22 PM
To: CGI Beginners
Subject: Re: CGI...blea


--- Paul Burkett <[EMAIL PROTECTED]> wrote:
> Ok, this is odd, I got it so it wont redirect the webpage, but now it
won't
> change the camera. When I restore it to the original code it changes the
> camera but redirects the page to "500 Internet Server Error." Shouldn't
> STDIN work in CGI scripts?

The 500 error is an error that your Web server is returning.  It means that
the output of the
script is not as expected.  First, check your error logs.  These should give
you an idea of what
the actual problem is (if the program is not compiling, for example).  It
could also be some sort
of buffering issue where output is being sent to STDOUT before the headers
have been sent.  This
is a particularly insidious problem if you are calling external programs
with "system" or
backticks.  Read http://perl.plover.com/FAQs/Buffering.html for more
information.

If it's a buffering issue with a CGI script, include this at the top of the
script:

    $|++;

That should disable buffering for STDOUT.

As for STDIN, that depends upon what you are doing there.  Remember that
POST data from a form is
sent to and read from STDIN.  When you first instantiate a CGI object (or
make certain function
calls when using the function-oriented interface), then CGI.pm might read
the contents of STDIN,
as this is where it often expects to find form data.  If you have an
external program sending data
to STDIN, you may be having problems with CGI.pm clobbering the data (to be
fair, this will happen
with virtually any CGI parsing code).

If an external program is writing to STDIN, can you pipe the data somewhere
else and read it from
there?

Another tactic:  if you are using CGI.pm but are not using the form-handling
code, then tell
CGI.pm to take its data from another source.  One way is to do this:

  my $q = CGI->new("");

Then, you can use $q at will without clobbering STDIN.  This is often used
for debugging when you
want consistent query parameters:

  my $q = CGI->new('color=red&name=Ovid');

Cheers,
Curtis Poe

=====
Senior Programmer
Onsite! Technology (http://www.onsitetech.com/)
"Ovid" on http://www.perlmonks.org/

__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/

Reply via email to