develooper Front page | perl.qa | Postings from November 2011

Re: Capturing only STDERR with Capture::Tiny?

Thread Previous | Thread Next
From:
David Golden
Date:
November 30, 2011 02:16
Subject:
Re: Capturing only STDERR with Capture::Tiny?
Message ID:
CAOeq1c-sbrFYcS-pVpU_ZkyZ0RwkzLd0axU0yh+DE8ngNzxiqg@mail.gmail.com
On Tue, Nov 29, 2011 at 11:25 PM, Gabor Szabo <szabgab@gmail.com> wrote:
> What is your suggestion to solve this?
> Does a request for such feature in Capture::Tiny sound reasonable?

It's reasonable and has been requested before:

https://rt.cpan.org/Public/Bug/Display.html?id=60515

I haven't found the tuits to dive back into the mess and implement it.
 To some extent, I'm trying to keep this "Tiny" and not implement
every possible variation of capture that people might like.  To
another extent, I've not decided on an API that I like for doing the
variations.  (I cringed when I added 'capture_merged').

In the meantime, I think IO::CaptureOutput does what you want, albeit
I don't think it necessarily does all things as well as Capture::Tiny
(particularly anything dealing with layers)

  use IO::CaptureOutput qw/capture/;
  capture \&subroutine, \undef, \$stderr; # pass through to STDOUT

-- David

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About