diff options
author | Julien Fiegehenn <simbabque@cpan.org> | 2023-04-30 15:30:24 +0100 |
---|---|---|
committer | Olaf Alders <olaf@wundersolutions.com> | 2023-04-30 17:08:11 +0200 |
commit | a1fc22285289178dbb2923106bdc1cea8f7a9f02 (patch) | |
tree | 9733f05afa3d62ee670ba5df33bf372be0f289fa | |
parent | d635a7d73b3701b5d79675578cae454ce7f7d15b (diff) | |
download | uri-a1fc22285289178dbb2923106bdc1cea8f7a9f02.tar.gz |
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.
-rw-r--r-- | lib/URI/_query.pm | 2 |
1 files changed, 1 insertions, 1 deletions
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); } |