ActiveState Perl 5.6 - Can't exit WHILE loop 
Author Message
 ActiveState Perl 5.6 - Can't exit WHILE loop

Hi,

I hope someone can help.  I am trying to transfer a piece of code from a
Linux web server to an IIS5 server (running ActiveState Perl 5.6), and it
seems that it is getting stuck in the following WHILE loop:

while ($len != $ENV{'CONTENT_LENGTH'}) {
  $buffer = ' ';
  $len += sysread(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
  $input .= $buffer;

Quote:
}

My guess is that there is a command within the above code that is not
supported by the standard install of ActiveState Perl 5.6.

If someone can help with this problem, I would be most appreciative.

Cheers,

Daniel



Fri, 06 Aug 2004 10:20:38 GMT  
 ActiveState Perl 5.6 - Can't exit WHILE loop
This is just a shot in the dark, but...

Quote:
> Linux web server to an IIS5 server (running ActiveState Perl 5.6), and it
... [snip] ...
> while ($len != $ENV{'CONTENT_LENGTH'}) {

Are you certain $ENV{'CONTENT_LENGTH'} exists in your new (IIS5/AS
Perl5.6) environment?

It's more likely that I've just not been using it in the correct
fashion, but I've never seen $ENV{'CONTENT_LENGTH'} give me anything
besides "0" in my Windows environment. :)



Fri, 06 Aug 2004 14:03:32 GMT  
 ActiveState Perl 5.6 - Can't exit WHILE loop

Quote:
> Why do you need the whole while() loop ? If all you are doing is parsing
> form data, then this should be sufficient:
> read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});

> Of course you still need to de-webify hex-encoded characters and split
into
> name value pairs...
> --
> Regards,
> Chris
> (Webmaster, http://www.robtechnology.net/~skeleton-man/)

Am I missing something here?  Could you not just use the CGI module, which
would work identically on IIS and Apache.

Andy R.



Sat, 07 Aug 2004 08:43:38 GMT  
 ActiveState Perl 5.6 - Can't exit WHILE loop

This is probably safer:
while ($len < $ENV{'CONTENT_LENGTH'}) {

as opposed to:

Quote:
> while ($len != $ENV{'CONTENT_LENGTH'}) {

and make sure that $len is initialised to 0 before using it!


Sat, 07 Aug 2004 14:31:07 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. ActiveState Perl 5.6 and Roth pm's

2. MIME::Lite doesn't work on Win2000/Activestate 5.6

3. ActiveState Perl 5.6. and Language Localization

4. Install MailTools on ActiveState perl 5.6 !!!

5. NEWBIE: Using Win32::Eventlog under Activestate Perl 5.6 (Win XP)

6. Perl 5.6 Activestate crashes in Windows 98

7. NEWBIE: Using Win32::Eventlog under Activestate Perl 5.6 (Win XP)

8. Mail::Sender bad file descriptor (Apache for Win32 on win2k, ActiveState Perl 5.6, Win2k SMTP server)

9. Net::Daemon on activestate perl 5.6

10. ptkdb and ActiveState Perl 5.6 Win32

11. mod_perl with activestate perl 5.6 on win32?

12. Install MailTools on ActiveState perl 5.6 !!!

 

 
Powered by phpBB® Forum Software