From e01fe4f05196b56775fffffe23572ec648b14ec6 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Tue, 23 Feb 2021 03:38:21 +0600 Subject: treewide: avoid "delete local" construct on hashes Apparently this feature is only in Perl 5.12+, and we're still on Perl 5.10. --- lib/PublicInbox/Spawn.pm | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'lib/PublicInbox/Spawn.pm') diff --git a/lib/PublicInbox/Spawn.pm b/lib/PublicInbox/Spawn.pm index 00e6829e..fe7aa0a8 100644 --- a/lib/PublicInbox/Spawn.pm +++ b/lib/PublicInbox/Spawn.pm @@ -358,10 +358,9 @@ sub spawn ($;$$) { my $f = which($cmd->[0]) // die "$cmd->[0]: command not found\n"; my @env; $opts ||= {}; - - my %env = $env ? (%ENV, %$env) : %ENV; + my %env = (%ENV, $env ? %$env : ()); while (my ($k, $v) = each %env) { - push @env, "$k=$v"; + push @env, "$k=$v" if defined($v); } my $redir = []; for my $child_fd (0..2) { -- cgit v1.2.3-24-ge0c7