dracos has asked for the wisdom of the Perl Monks concerning the following question:
ok, I am having issues with the following code STDERR seems to be ending up in the STDOUT handle on the open3
#!/usr/bin/perl use strict; use warnings; use IPC::Open3; chdir "C:\\"; my ( $writer, $reader, $err, $pid ); my $SVN_LIST = "svn status --depth infinity --no-ignore C:\\Nonexistan +t_DIR"; $pid = open3( $writer, $reader, $err, $SVN_LIST ); waitpid $pid, 0; while (<$err>) { # causes "Use of uninitialized value $err in <HANDLE> +" print "$_"; # and "readline() on unopened filehandle" } while (<$reader>) { print "$_"; # Prints the error message } $SVN_LIST = `svn status --depth infinity --no-ignore C:\\Nonexistant_D +IR`; #error message comes out on STDERR since it isn't captured. print "$SVN_LIST"; # prints nothing.
when I run this the SVN command in a cmd shell it will return via STDERR "svn: warning: 'C:\Nonexistant_DIR' is not a working copy". I have proved it to myself by running the following on a command prompt
svn status --depth infinity --no-ignore C:\NON_EXISTANT_DIR > xxx 2> e +rr
With this the file xxx is empty and the file err has the data in it.
What am I missing on the open3 that I am not getting STDERR output in what from my reading should be in the $err I pass.
Or is the issue I am having related to the fact I am running on a Windows platform
I am using activestate perl version v5.16.3 built for MSWin32-x86-multi-thread.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Issues with IPC::Open3 on win32
by Don Coyote (Hermit) on Apr 01, 2014 at 22:21 UTC | |
|
Re: Issues with IPC::Open3 on win32
by zentara (Cardinal) on Apr 02, 2014 at 09:58 UTC |