Capture-Tiny 0.08

I've released a new version of Capture::Tiny, which now catches exceptions, cleans up file handles, then rethrows the exception. This is the first major bug-fix in a while and was easy to address.

I'm feeling pretty confident that Capture::Tiny is a robust, cross-platform answer for any sort of output capturing. If you'd like to understand why, the slides from my talk, "How (not) to capture output in Perl", provide an explanation of why most other output capture approaches are flawed and why this is the single best tool for the job.

This entry was posted in perl programming and tagged , . Bookmark the permalink. Both comments and trackbacks are currently closed.

4 Comments

  1. Posted June 21, 2010 at 7:09 pm | Permalink

    Hi

    We /know/ it's a fabulous module.

    Since I think that beginners should not be deliberately confused with the mantra TMTOWTDI, I now always recommend Config::Tiny, Capture::Tiny and Try::Tiny.

    They might just happen to all be *::Tiny, and that might just happen to be an accident, but I doubt it.

    Cheers
    Ron

  2. Posted June 22, 2010 at 1:26 am | Permalink

    It's no accident that modules designed to be trivial to install and which implement just core functionality are ideal for newbies.

    A lot of the concept of a ::Tiny series of modules was inspired by things like SQLite, which show similar properties.

  3. Jakub Narębski
    Posted June 22, 2010 at 6:21 am | Permalink

    It wuld be nice if Capture::Tiny allowed to catch only STDOUT, making everything writen to STDERR fall through (and not caught). But that's probably out of scope of *::Tiny module...

    BTW. what's wrong with

    use PerlIO::Util;

    my $data = '';
    *STDOUT->push_layer(scalar => \$data);
    ...
    *STDOUT->pop_layer();

    • dagolden
      Posted June 22, 2010 at 8:52 pm | Permalink

      Just setting a scalar layer only affects output from Perl. It won't capture output from a sub-process executed via system().

© 2009-2014 David Golden All Rights Reserved