in reply to How do I capture large output in a perl variable

Are you sure you're missing data in the output? When I do this sort of thing, I include some size information in some debugging output:

my $data = ` ... `; print "Got data length [$data]\n";

However, if you are expecting a lot of data, you don't need to store it all in memory (unless you need it for something else). You can open a pipe and read from it. When you get a line from the pipe, you send it to the browser.

open PIPE, " ... | "; while( <PIPE> ) { ... do stuff ... print; } close PIPE or die "Got error [$!|$?]\n";

While debugging these things, I tend to output everything as "text/plain" so I see exactly what's going on, or I use a perl script (perhaps using WWW::Mechanize) to grab and save the output so I can inspect it later.

Good luck :)

--
brian d foy <bdfoy@cpan.org>

Replies are listed 'Best First'.
Re^2: How do I capture large output in a perl variable
by cowboy (Friar) on Mar 22, 2005 at 22:31 UTC
    "text/plain" is great for debugging stuff like this, just be careful of things like internet explorer (and others? are there any), that don't follow the standards, and may or may not decide that it's text, and may instead try to display it as html, or whatever else it feels like.