Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
Thanks for the update. But I'm still a little confused about your code. You say that the last snippet produces the intended display for a small amount of data, so it seems like your problem arises when you try to display a large amount of data. I think that makes sense.

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:

# 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); }
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()".

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

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (3)
As of 2024-04-24 02:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found