Hi,
I am having problem in displaying large size of varaible on web page. Below is the Example:
$retHashRef{$viewItem[0]} = $viewStr;
Here in this example I am returning \%retHashRef to calling program. $viewStr is very big in size lets say 2 MB.
When I do print $viewStr, it does print. But when i am trying to print inside HTML like this it doesn't display anything:
foreach my $row (keys %$dbDDL) { push @rowArr, '<pre> ' . '<font size=2>' .$dbDDL->{$row} . '</font>' +. '</pre>' ; &P3::util::HTML::doTableDetailRow($altColor, @rowArr); }
Can somebody Please advice me why this is happening ? Thanks in advance.
Note : When I do just print $dbDDL->{$row}, it does print.
Update: Thanks for the response. And sorry for not being very clear in my post.
When I try to display small string it does display properly. This happens only when string size is very big.
Regarding P3::Util::HTML module, that is our own module and there is no problem in this.
Here is the code :
module name : Dbschema.pm this is portion of method that populate the hash for string. sub getViewProcs { my $lineNo=0; my $text; while (my $row = $sth->fetchrow_arrayref()) { ## Store + all columns value in array of hash #Add ownership information to views $text = $row->[0]; if ( !$lineNo ) { $text =~ s/^\s*create\s+view\s+$viewItem[0]\s+ +/create view $viewItem[1].$viewItem[0] /i; } $lineNo++; for (my $i=0;$i<length($text);$i+=100) { my $slice = substr($text, $i, 100); $viewStr .= $slice; } } } $retHashRef{$viewItem[0]} = $viewStr; } my ($procDDL) = $self->getViewProcs($dbase,'P'); if($procDDL){ foreach my $procStr (keys %$procDDL) { $pDDL .= "$procDDL->{$procStr}"; } $pDDL .= "$goTxt"; } $retHashRef{PROC} = $pDDL;
this is the code that does display on browswer.
This is the script that does take care of displaying og HTML my ($dbDDL) = $dbObj->getDbSchema($sourcedb,'%'); &P3::util::HTML::startTable("$sourcedb ",undef,undef,undef,un +def,$colexp); foreach my $row (keys %$dbDDL) { &P3::util::HTML::doTableColAttributes(''); # Reset the Co +lumn Attributes $altColor = !$altColor; my @rowArr; push @rowArr, '<pre> ' . '<font size=2>' .$dbDDL->{$row} +. '</font>' . '</pre>' ; &P3::util::HTML::doTableDetailRow($altColor, @rowArr); }

In reply to 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":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.