From 758e7eaa5fee88078764650b4fb7a81b63ba32e5 Mon Sep 17 00:00:00 2001 From: bbrtj Date: Thu, 10 Oct 2024 21:15:29 +0200 Subject: [PATCH] Use do block instead of unnamed block in adapt_psgi --- lib/Kelp/Util.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/Kelp/Util.pm b/lib/Kelp/Util.pm index db268e7..ad76cbf 100644 --- a/lib/Kelp/Util.pm +++ b/lib/Kelp/Util.pm @@ -138,16 +138,16 @@ sub adapt_psgi $path =~ s{^/?}{/}; $path =~ s{/?$}{$trailing_slash}; - my $result; - { + my $result = do { + # adjust script and path local $env->{SCRIPT_NAME} = $orig_path; $env->{SCRIPT_NAME} =~ s{\Q$path\E$}{}; local $env->{PATH_INFO} = $path; # run the callback - $result = $app->($env); - } + $app->($env); + }; # produce a response if (ref $result eq 'ARRAY') {