summaryrefslogtreecommitdiff
path: root/lib/open2.pl
diff options
context:
space:
mode:
authorPerl 5 Porters <perl5-porters@africa.nicoh.com>1996-05-01 04:10:28 +0000
committerCharles Bailey <bailey@genetics.upenn.edu>1996-05-01 04:10:28 +0000
commit6ecfc29d5a0d124e6e6ffb770d1f00e249928746 (patch)
tree2ac3bc65a0158f031ce739cd76f3383b1ce84922 /lib/open2.pl
parent01d0d956947d0fae590145ef30d50b879af36b0e (diff)
downloadperl-6ecfc29d5a0d124e6e6ffb770d1f00e249928746.tar.gz
Eliminate use of $& to avoid runtime penalty
Diffstat (limited to 'lib/open2.pl')
-rw-r--r--lib/open2.pl4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/open2.pl b/lib/open2.pl
index dcd68a8cd3..7d3b97030b 100644
--- a/lib/open2.pl
+++ b/lib/open2.pl
@@ -28,8 +28,8 @@ sub main'open2 {
# force unqualified filehandles into callers' package
local($package) = caller;
- $dad_rdr =~ s/^[^']+$/$package'$&/;
- $dad_wtr =~ s/^[^']+$/$package'$&/;
+ $dad_rdr =~ s/^([^']+$)/$package'$1/;
+ $dad_wtr =~ s/^([^']+$)/$package'$1/;
local($kid_rdr) = ++$fh;
local($kid_wtr) = ++$fh;