Just use tie inside the code that will be evaluated and return $catcher. Maybe you should use eval() and not run() to get this working.

Can't test Perl.pm here since it doens't compile for Win32.

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


In reply to Re^5: Challenge: Capturing stdout from a function call. by gmpassos
in thread Challenge: Capturing stdout from a function call. by BUU

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