It seems there is a bug in ActivePerl 5.6 for NT when using CGI.pm and
trying to print strings larger than about 62KB. I ran across this initially
building a web interface which was creating a list of OPTION tags that ran
just over 62K itself. After a huge amount of testing and debugging, I
realized that the mere inclusion of CGI.pm via "use CGI" prevented any
string larger than about 62000 bytes from printing. Note, this applies
whether the print output is to the console/shell or via CGI. Rather than
post my (very large) original program, which would leave open a lot of
possible alternative explanations, I distilled it into what should be a nice
small, repeatable example.

use CGI;
my $string="abcdefghijklmnopqrstuvwxyz\n" x 2500;
print $string,"\n";
print "Length of string is ", length $string, "\n";

If you run this, it should not print anything. Comment out the "use CGI"
line, and it should print 2500 lines. Also, if you lower the multiplier to
2275 or lower, it will print (that puts the string length just under the
problem limit); 2276 and you get no output. It does not seem to matter what
the content of the string is - originally it was about 850 <OPTION> tags
that were part of an HTML page generated on the fly, and I've tried
generating a bunch of different kinds of gibberish as well. All give the
same result. Also note that if you have the multiplier at 2500 the "Length
of string is" line also doesn't print; if you move that line above the
"print $string" line, you do get the "Length of string is" output. Does that
suggest some kind of an output buffering problem?

I've repeated this with identical results on 3 machines running NT, using
ActivePerl 5.6 builds 620 and 623, using CGI.pm version 2.74 (originally)
and 2.752 (the latest) and the results are unchanged. I've also run this on
Solaris 2.7, ActivePerl 5.6 (again builds 620 and 623), and the bug does not
seem to be present. Also, just for comparison, I ran it on FreeBsd 4.0 with
perl 5.005_03 and I can't reproduce the bug there either. This leads me to
believe it is most likely a bug with the NT implementation of ActivePerl, or
possibly a problem with CGI.pm that only shows up with NT ActivePerl. I've
already submitted a very detailed bug report to Lincoln Stein just in case.

I'd appreciate it if a few people could try running this program on NT and
see if they get the same result. If so, it's definitely a bug to be fixed in
ActivePerl, particularly when you consider how often perl is used for CGI
programs which create (potentially) very large HTML output; given how long
it took me to stumble on the bug, I'd hate to think other people are
figuring there is a problem with their code when it's really ActivePerl.

Looking forward to hearing some feedback,

Barry

----
Barry Hemphill
[EMAIL PROTECTED]
Courseware Developer/Instructor
Concord Communications

"Human beings, who are almost unique in having the ability to learn from the
experience of others, are also remarkable for their apparent disinclination
to do so."
-- Douglas Adams, Last Chance to See


**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept by
the latest virus scan software available for the presence of computer viruses.

**********************************************************************
_______________________________________________
ActivePerl mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/activeperl

Reply via email to