Capture-Tiny icon indicating copy to clipboard operation
Capture-Tiny copied to clipboard

No STDERR capture from XS/C under Windows [rt.cpan.org #71701]

Open dagolden opened this issue 12 years ago • 3 comments

https://rt.cpan.org/Ticket/Display.html?id=71701

The attached simple case doesn't capture STDERR in Windows. Seems ok on all other platforms. 
It's not clear to me if this is a Windows thing you can't do anything about? This is a minimal 
example of a general issue of not capturing STDERR from XS/external libs in windows.

dagolden avatar Mar 27 '13 19:03 dagolden

This may be related, so not opening a new ticket, but I am also seeing stderr (not stdout) not being captured from a system statement on Windows only:

use strict;
use warnings;
use 5.010;
use Capture::Tiny qw( capture );

my (undef, $stderr) = capture { system $^X, -e => 'print STDERR "some error"' };
say $stderr;  # prints nothing on MSWin32

this does work:

my (undef, $stderr) = capture { print STDERR "some error" };

plicease avatar Feb 18 '16 17:02 plicease

Could you please post/gist your perl -V output?

xdg avatar Feb 18 '16 17:02 xdg

https://gist.github.com/plicease/38f40e0bb5392bad42fe

this is a fairly standard Strawberry 5.22.1 install.

plicease avatar Feb 18 '16 17:02 plicease