From 585d8f16aa75530c963b478643b30092eb29d445 Mon Sep 17 00:00:00 2001 From: Andreas Huber Date: Thu, 28 Dec 2023 14:18:00 +0100 Subject: [PATCH] click_button: fix count of present exclusive options (quick fix) with options "x" and/or "y", @present_exclusive_options would contain "undef" elements, which will be counted too. Therefore click_button with x and y will always have more than > 1 options. --- lib/WWW/Mechanize.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/WWW/Mechanize.pm b/lib/WWW/Mechanize.pm index a5fb033f..6939f9e2 100644 --- a/lib/WWW/Mechanize.pm +++ b/lib/WWW/Mechanize.pm @@ -2538,7 +2538,8 @@ sub click_button { value => 1, ); - my @present_exclusive_options = @exclusive_options{ keys %args }; + my @present_exclusive_options + = map { $_ || () } @exclusive_options{ keys %args }; if ( scalar @present_exclusive_options > 1 ) { $self->die(