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 :)
|
|---|
| 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 |