Skip Menu |

This queue is for tickets about the IO-Capture CPAN distribution.

Report information
The Basics
Id: 83043
Status: new
Priority: 0/
Queue: IO-Capture

People
Owner: Nobody in particular
Requestors: ALTREUS [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: (no value)
Fixed in: (no value)



Subject: Call stop on destruction
It would be handy if the object stopped itself when it went out of scope since that seems to be the only reason I can think of to use an object in the first place. :) Here's what I was doing: try { my $c = IO::Capture::Stderr->new; $c->start; $rev = git::rev_parse($rev) || git::rev_parse("origin/$rev"); } catch { die "Don't know what $rev is\n"; }; As it is, $c has to be declared outside the try block because I need to use it in the catch to stop it so that die actually dies to STDERR; but the effects of $c were intended only for the contents of the try, so it seems sensible to end its effects when it goes out of scope.