2010-07-01

Does the following look OK?

#! perl print "content-type: text/html\n\n"; my $stdin=<STDIN>;

When called in a browser,

(from a server using windows 2003, IIS 6, and perl

5.10), the page hangs and does a continuous load.

Note: my $stdin is not being printed (e.g. print $stdin;).

If <STDIN> is undefined,

then I believe $stdin=<STDIN>; would be also be undefined,

and calling the page would just display a blank page.

To expand my examples,

I am getting the same problem after I send something to STDIN as follows...

#! perl use warnings; use strict; print "content-type: text/html\n\n"; my$stdin=<STDIN>; print $stdin;

The html page that sends something to the STDIN page contains the following...

<html><body> <form src="my_stdin.pl" method="post"> <input type="text" name="TEXT"> <input type="submit"> </form> </body></html>

When the html page sends something to the STDIN page, the page still hangs and does a continuous load.

I'm believing the hanging is because of the configuration of the IIS 6 server.

What is your opinion about this ?

When responding, list some similar code that works, without CGI.pm or other Module, because I believe the above examples should work as is without any Modules. Although, I should note, that CGI.pm does work, both when param() is on the same page as the form, and when something is sent to another Page that prints the param().

Thanks.

- Look For God.


In reply to STDIN not working, STDIN hanging by FRIENDOFGOD

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.