Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

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

Report information
The Basics
Id: 56614
Status: resolved
Priority: 0/
Queue: Capture-Tiny

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

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



Subject: Cature the exit code of the program being run
Hi David Would it be possible to capture the exit code for the program being run, and to make that available? That's be /very/ useful. Cheers Ron
Subject: Re: [rt.cpan.org #56614] Cature the exit code of the program being run
Date: Thu, 15 Apr 2010 07:05:07 -0400
To: bug-Capture-Tiny [...] rt.cpan.org
From: David Golden <dagolden [...] cpan.org>
On Thu, Apr 15, 2010 at 2:07 AM, RSAVAGE via RT <bug-Capture-Tiny@rt.cpan.org> wrote: Show quoted text
> Would it be possible to capture the exit code for the program being run, > and to make that available?
Because Capture::Tiny can be used for things other than just running programs, it doesn't capture exit codes. it does, however, preserve $?. So this should just work: capture { system(@cmd) }; if ( $? ) { ... } Is that sufficient for your needs? -- David
Subject: Re: [rt.cpan.org #56614] Cature the exit code of the program being run
Date: Fri, 16 Apr 2010 08:52:27 +1000
To: bug-Capture-Tiny [...] rt.cpan.org
From: Ron Savage <ron [...] savage.net.au>
Hi David On Thu, 2010-04-15 at 07:05 -0400, David Golden via RT wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=56614 > > > On Thu, Apr 15, 2010 at 2:07 AM, RSAVAGE via RT > <bug-Capture-Tiny@rt.cpan.org> wrote:
> > Would it be possible to capture the exit code for the program being run, > > and to make that available?
> > Because Capture::Tiny can be used for things other than just running > programs, it doesn't capture exit codes. it does, however, preserve > $?. So this should just work: > > capture { system(@cmd) }; > if ( $? ) { > ... > } > > Is that sufficient for your needs?
Absolutely! He, he, he, you don't miss much. You can close the 'bug' report. -- Ron Savage ron@savage.net.au http://savage.net.au/index.html
<grin> You might enjoy "How (Not) To Capture Output in Perl" on my talks page: http://www.dagolden.com/index.php/talks/ Closing the ticket. -- David