From fd19819fd94384529355ea7f3db2f395a1f5929b Mon Sep 17 00:00:00 2001 From: James Adams Date: Wed, 23 Aug 2023 15:11:39 +0100 Subject: [PATCH] test exception: Replace while-each with foreach --- src/test/perl/exception.t | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/test/perl/exception.t b/src/test/perl/exception.t index 281d454b..7bdd35ac 100644 --- a/src/test/perl/exception.t +++ b/src/test/perl/exception.t @@ -123,8 +123,8 @@ my $opts = {}; my $success_func = sub { my ($arg1, $arg2, %opts) = @_; push(@$args, $arg1, $arg2); - while (my ($k, $v) = each %opts) { - $opts->{$k} = $v; + foreach my $k (keys %opts) { + $opts->{$k} = $opts{$k}; }; return 100; };