Subject: | [PATCH] Fix for perl 5.19.4-to-be |
IPC::Pipeline relies on a bug in perl that has just been fixed.
When an argument is passed to a subroutine, it is passed by reference, so \$_[0] returns a reference to the same scalar that \$x would in the case of foo(\$x). That was not working with foo(undef), where \$_[0] would return a new scalar. That has been fixed.
This affects IPC::Pipeline, which accepts undef as an argument, but then tries to modify it, though it is read-only. The attached patch fixes that simply by wrapping the assignment in an eval.
BTW, the README doesn’t say where to report bugs, nor does the pod.
Subject: | open_0XLLYGLF.txt |
diff -rup IPC-Pipeline-0.8-EyRxQJ-orig/lib/IPC/Pipeline.pm IPC-Pipeline-0.8-EyRxQJ/lib/IPC/Pipeline.pm
--- IPC-Pipeline-0.8-EyRxQJ-orig/lib/IPC/Pipeline.pm 2013-01-24 08:35:47.000000000 -0800
+++ IPC-Pipeline-0.8-EyRxQJ/lib/IPC/Pipeline.pm 2013-08-29 00:31:08.000000000 -0700
@@ -95,7 +95,7 @@ sub pipeline {
#
if ( !defined $_[0] ) {
- $_[0] = $in;
+ eval { $_[0] = $in };
}
elsif ( ref( $_[0] ) eq 'GLOB' ) {
open( $_[0], '>&=' . fileno($in) );
@@ -105,7 +105,7 @@ sub pipeline {
}
if ( !defined $_[1] ) {
- $_[1] = $child_out;
+ eval { $_[1] = $child_out };
}
elsif ( ref( $_[1] ) eq 'GLOB' ) {
open( $_[1], '<&=' . fileno($child_out) );
@@ -115,7 +115,7 @@ sub pipeline {
}
if ( !defined $_[2] ) {
- $_[2] = $error_out;
+ eval { $_[2] = $error_out };
}
elsif ( ref( $_[2] ) eq 'GLOB' ) {
open( $_[2], '<&=' . fileno($error_out) );