Hmm, I was just adapting a large application I wrote some years ago to work
with mod_perl.  Much to my amazement, despite its complexity and the fact that
it was largely written before mod_perl, it worked without modification!  Well,
almost.  There is one problem:

When handling form uploads, it calls read() from perl and expects it to act
just like the perl version.  But Apache.pm's read() does one notable thing
differently.  If you do a 'read(STDIN, $buf, $size)', Apache.pm's read
concatenates the new data to the previous contents of $buf instead of replacing
it.

Now it is not that hard to clear the buffer before each read, but the unusual
behavior breaks other things too, like the form uploads in CGI_Lite.  Is the
concatenation an intentional feature, or is it a bug?

Besides this it really is remarkable how perfectly mod_perl reproduces the CGI
environment!

Cyrus

Reply via email to