Re: Capturing only STDERR with Capture::Tiny?

David Golden <[email protected]>
Newsgroups gmane.comp.lang.perl.quality-assurance
Message-ID <CAOeq1c-sbrFYcS-pVpU_ZkyZ0RwkzLd0axU0yh+DE8ngNzxiqg@mail.gmail.com>
On Tue, Nov 29, 2011 at 11:25 PM, Gabor Szabo <[email protected]> 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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.