about summary refs log tree commit homepage
path: root/lib/PublicInbox/LeiRediff.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2023-10-01 09:54:27 +0000
committerEric Wong <e@80x24.org>2023-10-01 22:41:48 +0000
commitb231d91f42d791becf7b6861e723833d71e73237 (patch)
tree02e4efac6c8af7b1735f5e75cb0c7209c57e998d /lib/PublicInbox/LeiRediff.pm
parent3b8315e371c322ff59b31b36b14d9b7568e708fe (diff)
downloadpublic-inbox-b231d91f42d791becf7b6861e723833d71e73237.tar.gz
While forked processes inherit from the parent, exec-ed
processes need the `-w' flag passed to them.  To determine
whether or not we should pass them, we must check the `$^W'
global perlvar, first.

We'll also favor `perl -e' over `perl -E' in places where
we don't rely on the latest features, since `-E' incurs
slightly more startup time overhead from loading feature.pm
(while `perl -Mv5.12' does not).
Diffstat (limited to 'lib/PublicInbox/LeiRediff.pm')
-rw-r--r--lib/PublicInbox/LeiRediff.pm4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/PublicInbox/LeiRediff.pm b/lib/PublicInbox/LeiRediff.pm
index 6cc6131b..a886931c 100644
--- a/lib/PublicInbox/LeiRediff.pm
+++ b/lib/PublicInbox/LeiRediff.pm
@@ -140,7 +140,7 @@ EOM
 
 sub wait_requote { # OnDestroy callback
         my ($lei, $pid, $old_1) = @_;
-        $lei->{1} = $old_1; # closes stdin of `perl -pE 's/^/> /'`
+        $lei->{1} = $old_1; # closes stdin of `perl -pe 's/^/> /'`
         waitpid($pid, 0) == $pid or die "BUG(?) waitpid: \$!=$! \$?=$?";
         $lei->child_error($?) if $?;
 }
@@ -150,7 +150,7 @@ sub requote ($$) {
         my $old_1 = $lei->{1};
         my $opt = { 1 => $old_1, 2 => $lei->{2} };
         # $^X (perl) is overkill, but maybe there's a weird system w/o sed
-        my ($w, $pid) = popen_wr([$^X, '-pE', "s/^/$pfx/"], $lei->{env}, $opt);
+        my ($w, $pid) = popen_wr([$^X, '-pe', "s/^/$pfx/"], $lei->{env}, $opt);
         $w->autoflush(1);
         binmode $w, ':utf8'; # incompatible with ProcessPipe due to syswrite
         $lei->{1} = $w;