better trial version handling
[p5sagit/JSON-MaybeXS.git] / lib / JSON / MaybeXS.pm
index 302b01c..376853a 100644 (file)
@@ -5,7 +5,7 @@ use warnings FATAL => 'all';
 use base qw(Exporter);
 
 our $VERSION = '1.004000';
-$VERSION = eval $VERSION;
+$VERSION =~ tr/_//d;
 
 sub _choose_json_module {
     return 'Cpanel::JSON::XS' if $INC{'Cpanel/JSON/XS.pm'};
@@ -16,7 +16,7 @@ sub _choose_json_module {
     return 'Cpanel::JSON::XS' if eval { require Cpanel::JSON::XS; 1; };
     push @err, "Error loading Cpanel::JSON::XS: $@";
 
-    return 'JSON::XS' if eval { require JSON::XS; 1; };
+    return 'JSON::XS' if eval { require JSON::XS; JSON::XS->VERSION(3.0); 1; };
     push @err, "Error loading JSON::XS: $@";
 
     return 'JSON::PP' if eval { require JSON::PP; 1 };
@@ -205,6 +205,8 @@ Since this is a bare sub in the various backend classes, it cannot be called as
 a class method like the other interfaces; it must be called as a function, with
 no invocant.  It supports the representation used in all JSON backends.
 
+Available since version 1.002004.
+
 =head1 CONSTRUCTOR
 
 =head2 new