Take a look at Re: How do I redirect STDERR to a subroutine? and here you also have a Open3 example Re: Program arg interfering with redirecting STDERR to STDOUT

Graciliano M. P.
"Creativity is the expression of the liberty".


In reply to Re: How to capture STDOUT/STDERR of a function by gmpassos
in thread How to capture STDOUT/STDERR of a function by johnnywang

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":