browser: force perl decode of caniuse json
[sheet.git] / tools / mkcaniuse
index eaadead73056ff3da105de490c21a077bb98264a..07531d48c019b03b3411ccab9026b8c743444144 100755 (executable)
@@ -1,24 +1,27 @@
 #!/usr/bin/env perl
-use 5.010;
-use strict;
+use 5.014;
 use warnings;
 
 use Data::Dump 'pp';
-use JSON;
+use JSON::PP;
 use File::stat;
 use Time::Piece;
 
-our $VERSION = '1.01';
+our $VERSION = '1.02';
 
 local $/;  # slurp
 my $source = readline;
 
-my $data = from_json($source);
+$JSON::PP::false = 0;
+$JSON::PP::true  = 1;
+
+my $data = decode_json($source);
 my $update = eval { stat(${^LAST_FH} // $ARGV)->mtime }
        or warn "Could not determine input time\n";
 $data->{-date} = Time::Piece->new($update)->datetime;
 
-print pp($data);
+say "# automatically generated by $0";
+print '+', pp($data);
 
 __END__