From bfb2d712e794b816b3889caa28f0b16f8b77e6f9 Mon Sep 17 00:00:00 2001 From: Juerd Waalboer Date: Sun, 17 Nov 2024 03:37:37 +0100 Subject: [PATCH] nomoney: limit scope for variable --- plugins/nomoney | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/nomoney b/plugins/nomoney index 2e9bcf2..21265a3 100644 --- a/plugins/nomoney +++ b/plugins/nomoney @@ -18,8 +18,6 @@ sub _derive_plugin($symbol) { return; } -my %unresolved; # to keep state, keyed per real cart - sub _inform($unresolved, $username, $skip_print = 0) { call_hooks("beep"); @@ -45,6 +43,8 @@ sub _inform($unresolved, $username, $skip_print = 0) { } } +my %unresolved; # to share state between hooks, keyed per real cart + sub hook_checkout_prepare($class, $cart, $username, $transaction_id, @) { my $unresolved = $unresolved{$cart} = RevBank::Cart->new;