in reply to Re: Re: How to collect the stdout of a subroutine call?
in thread How to collect the stdout of a subroutine call?

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
  • Comment on Re: Re: Re: How to collect the stdout of a subroutine call?