in reply to Re: Challenge: Capturing stdout from a function call.
in thread Challenge: Capturing stdout from a function call.

What a brilliant ide! It's too bad tie doesn't work. Maybe you should try testing your solution first?
  • Comment on Re^2: Challenge: Capturing stdout from a function call.

Replies are listed 'Best First'.
Re^3: Challenge: Capturing stdout from a function call.
by gmpassos (Priest) on Oct 23, 2004 at 07:54 UTC
    Tested on Perl 5.6.1 and it works. Depending on your Perl version you need to add the sub STORE {} to no get errors.

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

      Yes, it works on the trivial example you used. It does not work with Perl.pm.
        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".