diff options
author | Perl 5 Porters <perl5-porters@africa.nicoh.com> | 1996-05-01 04:10:28 +0000 |
---|---|---|
committer | Charles Bailey <bailey@genetics.upenn.edu> | 1996-05-01 04:10:28 +0000 |
commit | 6ecfc29d5a0d124e6e6ffb770d1f00e249928746 (patch) | |
tree | 2ac3bc65a0158f031ce739cd76f3383b1ce84922 /lib/open2.pl | |
parent | 01d0d956947d0fae590145ef30d50b879af36b0e (diff) | |
download | perl-6ecfc29d5a0d124e6e6ffb770d1f00e249928746.tar.gz |
Eliminate use of $& to avoid runtime penalty
Diffstat (limited to 'lib/open2.pl')
-rw-r--r-- | lib/open2.pl | 4 |
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; |