Subject: | Version checks fail ("our $VERSION" moved before "package Locale::SubCountry") |
$ perl -e 'use Locale::SubCountry 54'
Locale::SubCountry does not define $Locale::SubCountry::VERSION--version
check failed at -e line 1.
Sometime after version 1.50, "our $VERSION = 1.xx" was moved to the top
of the code, above any "package" declaration. It is therefore not
declaring $Locale::SubCountry::VERSION, and previously-working version
checks like "use Locale::SubCountry 1.42" now throw a fatal error.
The patch below adds a "package Locale::SubCountry" to the beginning of
the code. This seems like typical / best practice for modules, to avoid
any symbol exports from the intial "use" statements from polluting the
main:: namespace.
--- SubCountry.pm.ORIG 2012-09-18 13:02:15.702774878 -0700
+++ SubCountry.pm 2012-09-18 13:30:04.351443803 -0700
@@ -314,6 +314,8 @@
#-------------------------------------------------------------------------------
+package Locale::SubCountry;
+
use strict;
use warnings;
use locale;