laziness, impatience, and hubris | |
PerlMonks |
Re: Re: Re: How to collect the stdout of a subroutine call?by Roy Johnson (Monsignor) |
on Apr 19, 2004 at 19:15 UTC ( [id://346414]=note: print w/replies, xml ) | Need Help?? |
Your subroutine prints out information, rather than returning it. If you want to capture what is printed into a variable, you would need to have it run as a separate process (see fork) so that you can read its STDOUT. (Or, the easier way, just have it build up a string and return that, as so many others have suggested.)
The PerlMonk tr/// Advocate
In Section
Seekers of Perl Wisdom
|
|