CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

Home: Perl Programming Help: Advanced:
No eof at STDIN with IIS?



Apr 25, 2001, 12:20 AM

Post #1 of 2 (2074 views)
No eof at STDIN with IIS? Can't Post

The statement $inp=<STDIN> to read all input works ok in unix, but hangs in NT with IIS. If I use read(STDIN, $inp, $ENV{CONTENT_LENGTH}) it works, but why does the first statement hang? Do unix servers include an EOF at the end of STDIN and IIS doesn't?
Thank you in advance.


Apr 25, 2001, 9:33 AM

Post #2 of 2 (2068 views)
Re: No eof at STDIN with IIS? [In reply to] Can't Post

The statement...


should not be reading "all" the input. It should be reading the up to the first newline ("\n") because that is the default value of $/. That is why you often see things like...

@lines = <STDIN>

If you want to slurp the whole thing look to this post from the past. Remember to s/DATA/STDIN/g to the examples there and you also can skip the opening and closing of the file for your needs.

Your second version reads the correct amount because you tell it the length and it does not stop when it reaches a newline.

As to why it actually works on UNIX, perhaps the UNIX server does not send newlines inside the text but IIS does.

Sun Sep 9, 2001 - 1:46:40 GMT, a very special second in the epoch. How will you celebrate?


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives