From 564f254dcc2e3f39acb08baca4293544dcbce284 Mon Sep 17 00:00:00 2001 From: Graham Knop Date: Fri, 21 Jul 2023 18:56:02 +0200 Subject: [PATCH] check version with VERSION method, not import Trying to use import to check a version would sometimes check the version, but only if Exporter was being used. Otherwise, the version would throw an error or just be ignored. The correct way to check a version is using the VERSION method. --- lib/URL/Encode.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/URL/Encode.pm b/lib/URL/Encode.pm index 200248c..c96e795 100644 --- a/lib/URL/Encode.pm +++ b/lib/URL/Encode.pm @@ -20,7 +20,7 @@ BEGIN { if (!$use_pp) { eval { - require URL::Encode::XS; URL::Encode::XS->import('0.03'); + require URL::Encode::XS; URL::Encode::XS->VERSION('0.03'); }; $use_pp = !!$@; }