So, one way to look for a solution is to figure out how to get the job done with less data being sent to the browser (and maybe with less data being handled by the server, too).
As I said before, your "P3::util::HTML" module is unknown to the rest of us; if you don't want to start putting that code up for public review, that's okay, but you're on your own if that module turns out to be part of the problem. I noticed that there was a difference in how the two snippets use it:
The difference is that in the first snippet, @rows gets larger by one entry on each iteration, whereas in the second one, it's always a brand new array, with just one entry in it -- in effect, you could be passing a scalar (not an array) to "doTableDetailRow()".# original snippet (with the large amount of data, not working): foreach my $row (keys %$dbDDL) { push @rowArr, '<pre> ' . '<font size=2>' .$dbDDL->{$row} . '</font>' +. '</pre>' ; &P3::util::HTML::doTableDetailRow($altColor, @rowArr); } # update snippet (working with a small amount of data): foreach my $row (keys %$dbDDL) { &P3::util::HTML::doTableColAttributes(''); $altColor = !$altColor; my @rowArr; push @rowArr, '<pre> ' . '<font size=2>' .$dbDDL->{$row} . '</font +>' . '</pre>' ; &P3::util::HTML::doTableDetailRow($altColor, @rowArr); }
If the function really takes a "color" spec and an array (i.e. a list of strings) as its parameters, the list is either for cells on a row or for rows in a table. If it's supposed to take a list of cell values for one row, then the first snippet above is just wrong and will not display the data correctly -- and if you are handling 2 MB per entry in @row, it's disastrously wrong:
<table> <!-- first iteration: --> <tr><td>... 2MB string </td></tr> <!-- second iteration: --> <tr><td>... 2MB string </td><td>another 2MB string</td><tr> <!-- and so on ... --> </table>
For now, you are the only one in this discussion who can know the correct usage for that module. If you don't know, I hope for your sake that it's documented somewhere so you can RTFM.
In the meantime, you should still look into figuring out what the user of this web service is supposed to accomplish, and see if you can figure out how to enable that without requiring the person to scan megs of data in a table on his browser window.
In reply to Re^3: having problem in displaying large size of variable on web page
by graff
in thread having problem in displaying large size of variable on web page
by perlCrazy
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |