New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IPC::Open3 does not auto-create an error handle #9372
Comments
From fiji@ayup.limey.netCreated by fiji@ayup.limey.netThe POD for IPC::Open3 says: However, that always results in an undef $err. Looking at the source of the module I see (in the sub _open3): It clearly is not doing the magic to autogenerate the $err handle. Either the POD or the code needs to be fixed... the current behavior Perl Info
|
From renee.baecker@smart-websolutions.deThis is a small patch that solves the problem: rbaecker@www-devel-rbaecker ~/perl510/perl-5.10.0 $ ./perl -Ilib use strict; my ($wtr,$rdr,$err); my $pid = open3($wtr,$rdr,$err,'perl /home/rbaecker/perl510/bugs/test.pl'); print <$err>; rbaecker@www-devel-rbaecker ~/perl510/perl-5.10.0 $ cat ../bugs/test.pl use strict; warn "test"; rbaecker@www-devel-rbaecker ~/perl510/perl-5.10.0 $ Another related bug report is #31738 -- XING: http://www.xing.com/profile/Renee_Baecker |
From renee.baecker@smart-websolutions.deopen3.patch--- ../test/perl-5.10.0/lib/IPC/Open3.pm 2007-12-18 11:47:07.000000000 +0100
+++ lib/IPC/Open3.pm 2008-06-11 12:20:30.000000000 +0200
@@ -194,7 +194,7 @@
unless (eval {
$dad_wtr = $_[1] = gensym unless defined $dad_wtr && length $dad_wtr;
$dad_rdr = $_[2] = gensym unless defined $dad_rdr && length $dad_rdr;
- 1; })
+ $dad_err = $_[3] = gensym unless defined $dad_err && length $dad_err; })
{
# must strip crud for croak to add back, or looks ugly
$@ =~ s/(?<=value attempted) at .*//s;
|
The RT System itself - Status changed from 'new' to 'open' |
From p5p@perl.wizbit.beCiteren "fiji@ayup.limey.net (via RT)" <perlbug-followup@perl.org>:
[...]
If you read further in the POD it says: 'If either reader or writer is the null string, this will be replaced Which doesn't talk about $err. But what has to change? Changing the code might break a program that relies on $err being the Kind regards, Bram |
From renee.baecker@smart-websolutions.deSorry, the doc says: "If CHLD_ERR is false, or the same file descriptor as CHLD_OUT, then So the behaviour is documented. But it is really confusing to define a Renée Bäcker wrote:
-- Renée Bäcker XING: http://www.xing.com/profile/Renee_Baecker |
From ben@morrow.me.ukQuoth p5p@perl.wizbit.be (Bram):
The pod. Something like use Symbol qw/gensym/;
Yes. This (unfortunate) API decision is why Open3 couldn't be updated to Ben -- |
From @ikegami
That patch would break compatibility with the documented behaviour. use IPC::Open3 qw( open3 ); my $pid = open3( |
From @rgs2008/6/11 Ben Morrow <ben@morrow.me.uk>:
I tend to agree with that. But such an API modification would go with |
From mark.zealey@pipex.netHi all, could we get a doc change for this as was suggested: use Symbol qw/gensym/; It's misleading at the moment as the example given in the docs doesn't Thanks, Mark |
From module@renee-baecker.deOn Mi. 07. Jan. 2009, 08:06:40, mzealey wrote:
Hi Mark, can you provide a small patch and send it to Perl 5 Porters Cheers, |
From bitcard@profvince.comThanks for your report. Looks like this issue was a duplicate of RT Vincent |
bitcard@profvince.com - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#55570 (status was 'resolved')
Searchable as RT55570$
The text was updated successfully, but these errors were encountered: