diff options
author | Perl 5 Porters <perl5-porters@africa.nicoh.com> | 1996-05-01 04:10:19 +0000 |
---|---|---|
committer | Charles Bailey <bailey@genetics.upenn.edu> | 1996-05-01 04:10:19 +0000 |
commit | 5428dc403a489224dbeaeeb5a897d8844b0849f8 (patch) | |
tree | 7a8a56fddc13e74417621d54edbc65dd3a033bfb /lib/IPC | |
parent | 88e49c4edb2a787ae2511fc161f64df90409dd17 (diff) | |
download | perl-5428dc403a489224dbeaeeb5a897d8844b0849f8.tar.gz |
Eliminate $& to avoid runtime penalty
Diffstat (limited to 'lib/IPC')
-rw-r--r-- | lib/IPC/Open2.pm | 4 | ||||
-rw-r--r-- | lib/IPC/Open3.pm | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/lib/IPC/Open2.pm b/lib/IPC/Open2.pm index 243412ef09..62ec69b335 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 dbf5562028..fc93ab548d 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; |