This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Generalise IPC::Open3::xopen() to $n-argument open.
authorNicholas Clark <nick@ccl4.org>
Mon, 6 Jun 2011 14:16:37 +0000 (16:16 +0200)
committerNicholas Clark <nick@ccl4.org>
Sat, 11 Jun 2011 06:48:13 +0000 (08:48 +0200)
Previously it could only perform 2 argument open.

ext/IPC-Open3/lib/IPC/Open3.pm

index cdd47c3..14c5605 100644 (file)
@@ -9,7 +9,7 @@ require Exporter;
 use Carp;
 use Symbol qw(gensym qualify);
 
-$VERSION       = '1.10';
+$VERSION       = '1.11';
 @ISA           = qw(Exporter);
 @EXPORT                = qw(open3);
 
@@ -175,7 +175,9 @@ sub xclose_on_exec {
 # disallows a bareword while compiling under strict subs.
 
 sub xopen {
-    open $_[0], $_[1] or croak "$Me: open($_[0], $_[1]) failed: $!";
+    open $_[0], $_[1], @_[2..$#_] and return;
+    local $" = ', ';
+    carp "$Me: open(@_) failed: $!";
 }
 
 sub xclose {