browser: flatten json booleans in caniuse perl include
authorMischa POSLAWSKY <perl@shiar.org>
Thu, 12 Feb 2015 05:17:43 +0000 (06:17 +0100)
committerMischa POSLAWSKY <perl@shiar.org>
Fri, 13 Feb 2015 16:46:33 +0000 (17:46 +0100)
Newer versions of JSON return blessed objects for true/false which are
unneeded and result in unreadable Data::Dump::pp output.

tools/mkcaniuse

index eaadead73056ff3da105de490c21a077bb98264a..de3d789f5df9dcde5ebba811104f4e15104abf9a 100755 (executable)
@@ -13,12 +13,16 @@ our $VERSION = '1.01';
 local $/;  # slurp
 my $source = readline;
 
+$JSON::PP::false = 0;
+$JSON::PP::true  = 1;
+
 my $data = from_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__