From a1fc22285289178dbb2923106bdc1cea8f7a9f02 Mon Sep 17 00:00:00 2001 From: Julien Fiegehenn Date: Sun, 30 Apr 2023 15:30:24 +0100 Subject: disambiguate code for older Perls It seems there was a bug in Perl < 5.22 that led to defined immediately followed by a ternary '?' getting the parsing wrong. I checked this with RJBS at the PTC and he couldn't explain why, so I just added the brackets. --- lib/URI/_query.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/URI/_query.pm b/lib/URI/_query.pm index 8593ab0..6bedc36 100644 --- a/lib/URI/_query.pm +++ b/lib/URI/_query.pm @@ -74,7 +74,7 @@ sub query_form { } return if !defined($old) || !length($old) || !defined(wantarray); return unless $old =~ /=/; # not a form - map { defined ? do { s/\+/ /g; uri_unescape($_) } : undef } + map { ( defined ) ? do { s/\+/ /g; uri_unescape($_) } : undef } map { /=/ ? split(/=/, $_, 2) : ($_ => undef)} split(/[&;]/, $old); } -- cgit v1.2.1