From 1f2ddc7f2bae4a89dd91e1e371b88aab7e7f7ed4 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Fri, 28 Dec 2018 06:26:05 +0000 Subject: t/cgi.t: shorten %ENV setting No need to write our own loop when an assignment will do. --- t/cgi.t | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 't') diff --git a/t/cgi.t b/t/cgi.t index 2e2476d7..d92749b3 100644 --- a/t/cgi.t +++ b/t/cgi.t @@ -217,8 +217,7 @@ done_testing(); sub run_with_env { my ($env, @args) = @_; - my $init = sub { foreach my $k (keys %$env) { $ENV{$k} = $env->{$k} } }; - IPC::Run::run(@args, init => $init); + IPC::Run::run(@args, init => sub { %ENV = (%ENV, %$env) }); } sub cgi_run { -- cgit v1.2.3-24-ge0c7