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

You need to distinguish what you are capturing in the variable (which is almost certainly everything) from what you can see in a browser. For example, of course you don't see the stuff inside XML codes, the browser hides tags it doesn't recognize. I suspect that if you use view source in your browser, all of the stuff you thought you weren't capturing will be there. You need to use HTML to display things properly.
  • Comment on Re: How do I capture large output in a perl variable

Replies are listed 'Best First'.
Re^2: How do I capture large output in a perl variable
by vsmurthy (Initiate) on Mar 22, 2005 at 21:56 UTC
    Thanks for the suggestion. It is true that the XML tags and data within them is present if i check "view source" in my browser. I finally got that working by replace "<" by "&lt;"before displaying it in browser.
    But that is not the only problem. Other than the XML part, there is a large amount of data missing from the output which I normally get if i log onto my web server and run the same command on the command line, i.e, a large part of the output seems to be truncated when I run the command through the web page. What should I do to capture all the output into the perl variable?
      I'm still not convinced that the variable isn't capturing all of the output. Perhaps the output is different for different users and the CGI user's output is only a subset of what you get as yourself. It's also possible that the browser times out in downloading a large amount of data though I kind of doubt that. Change your CGI to print the output directly to a file on the server and examine that file to see what the variable is actually capturing.