my $var = `property <dataid>`; print "<td align="middle">$var</td>";
This command (property) sometimes produces an output of size almost 0.5Mb to 1Mb for some values of <dataid>(I checked the size of the output by executing the "property" command on the web server CLI).

So, your plan is to up upwards of 1MB of data into a single "<td>" element in the html that you output? Okay, I guess.

Regarding the presence of XML-tagged stuff in the middle of a plain-text stream: are you trying to show that verbatim, making all the XML tags visible?

And regarding your testing of the "property" program on the command line: are you sure that all the data ouput from this program is text? (Could there be non-printing control characters or other non-text, binary content? If so, what sort of operating system are you using, and do you need to specify "binary mode" for reading the data?)

It might be better (or at least, easier to debug) with a pipeline open statement:

my $var; open( PROG, "property $dataid |" ); # binmode PROG; # might need to do this? { local $/; # set input rec. separator to undef $var = <PROG>; # slurp output from property } close PROG; $var =~ s/</&lt;/g; # make sure browsers don't see XML tags as tags # if there is binary data, there's more you'll need to do # to make it presentable to a browser...
If you still have problems with that, you can switch to reading the "property" output line by line, and/or add some diagnostics, and/or move the data to the output HTML stream in smaller chunks.

In reply to Re: How do I capture large output in a perl variable by graff
in thread How do I capture large output in a perl variable by vsmurthy

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.