From: Perl 5 Porters Date: Wed, 1 May 1996 04:10:19 +0000 (+0000) Subject: Eliminate $& to avoid runtime penalty X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=5428dc403a489224dbeaeeb5a897d8844b0849f8;p=p5sagit%2Fp5-mst-13.2.git Eliminate $& to avoid runtime penalty --- diff --git a/lib/IPC/Open2.pm b/lib/IPC/Open2.pm index 243412e..62ec69b 100644 --- a/lib/IPC/Open2.pm +++ b/lib/IPC/Open2.pm @@ -80,8 +80,8 @@ sub open2 { # force unqualified filehandles into callers' package local($package) = caller; - $dad_rdr =~ s/^[^']+$/$package'$&/ unless ref $dad_rdr; - $dad_wtr =~ s/^[^']+$/$package'$&/ unless ref $dad_wtr; + $dad_rdr =~ s/^([^']+$)/$package'$1/ unless ref $dad_rdr; + $dad_wtr =~ s/^([^']+$)/$package'$1/ unless ref $dad_wtr; local($kid_rdr) = ++$fh; local($kid_wtr) = ++$fh; diff --git a/lib/IPC/Open3.pm b/lib/IPC/Open3.pm index dbf5562..fc93ab5 100644 --- a/lib/IPC/Open3.pm +++ b/lib/IPC/Open3.pm @@ -83,9 +83,9 @@ sub open3 { # force unqualified filehandles into callers' package my($package) = caller; - $dad_wtr =~ s/^[^:]+$/$package\:\:$&/ unless ref $dad_wtr; - $dad_rdr =~ s/^[^:]+$/$package\:\:$&/ unless ref $dad_rdr; - $dad_err =~ s/^[^:]+$/$package\:\:$&/ unless ref $dad_err; + $dad_wtr =~ s/^([^:]+$)/$package\:\:$1/ unless ref $dad_wtr; + $dad_rdr =~ s/^([^:]+$)/$package\:\:$1/ unless ref $dad_rdr; + $dad_err =~ s/^([^:]+$)/$package\:\:$1/ unless ref $dad_err; my($kid_rdr) = ++$fh; my($kid_wtr) = ++$fh;