From 094fbcb1db70d161866f51c3e91b4646d21e8f63 Mon Sep 17 00:00:00 2001 From: Juerd Waalboer Date: Mon, 16 Jan 2023 00:51:42 +0100 Subject: [PATCH] Fix bug/warning Apparently nobody uses "return ABORT;" in a hook, because it emitted an ugly warning. main::abort() takes a list, so destructuring the message to a scalar was wrong. --- lib/RevBank/Plugins.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/RevBank/Plugins.pm b/lib/RevBank/Plugins.pm index 2bc4086..4108eb7 100644 --- a/lib/RevBank/Plugins.pm +++ b/lib/RevBank/Plugins.pm @@ -22,10 +22,10 @@ sub call_hooks($hook, @args) { my $method = "hook_$hook"; for my $class (@plugins) { if ($class->can($method)) { - my ($rv, $message) = $class->$method(@args); + my ($rv, @message) = $class->$method(@args); if (defined $rv and ref $rv) { - main::abort($message) if $rv == ABORT; + main::abort(@message) if $rv == ABORT; warn "$class->$method returned an unsupported value.\n"; } }