Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^2: having problem in displaying large size of variable on web page

by perlCrazy (Monk)
on Sep 28, 2007 at 05:47 UTC ( #641473=note: print w/ replies, xml ) Need Help??


in reply to Re: having problem in displaying large size of variable on web page
in thread having problem in displaying large size of variable on web page

Thanks for response.
yes it does work with small string. I have updated my post and also posted portion of code that does display on browser.


Comment on Re^2: having problem in displaying large size of variable on web page
Re^3: having problem in displaying large size of variable on web page
by graff (Chancellor) on Sep 28, 2007 at 22:43 UTC
    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.

      Thanks for your response. Yes, I am looking for some work-around and trying to find some other solution for this requirement.
      May be I can write the data into a file then provide the option for download that file.
      Thanks for advice and help.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://641473]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (4)
As of 2014-09-01 18:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite cookbook is:










    Results (15 votes), past polls