in reply to Re: IPC::Open3 misbehaving when STDOUT is not FD #1
in thread IPC::Open3 misbehaving when STDOUT is not FD #1
#!/usr/bin/perl use warnings; use strict; use IPC::Open3; use Test::More tests => 1; use File::Spec; my $devnull = File::Spec->devnull; # Hide undesired output. open(STDOUT, '>', $devnull); open(STDERR, '>', $devnull); # Associate STDOUT and STDERR with # descriptors other than 1 and 2. open(local *STDOUT, '>', $devnull); open(local *STDERR, '>', $devnull); open3( undef, local *PIPE, undef, qq!$^X -le "print 111;print STDERR 222"!, ); my $pipe = ''; $pipe .= $_ while <PIPE>; is($pipe, "111\n222\n"); __END__
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: IPC::Open3 misbehaving when STDOUT is not FD #1
by ikegami (Patriarch) on Jun 06, 2009 at 07:19 UTC |