From: Mischa POSLAWSKY Date: Thu, 12 Feb 2015 05:17:43 +0000 (+0100) Subject: browser: flatten json booleans in caniuse perl include X-Git-Tag: v1.7~161 X-Git-Url: http://git.shiar.nl/sheet.git/commitdiff_plain/9fdb790af227473fc9d01416254aeb9d82df47ce browser: flatten json booleans in caniuse perl include Newer versions of JSON return blessed objects for true/false which are unneeded and result in unreadable Data::Dump::pp output. --- diff --git a/tools/mkcaniuse b/tools/mkcaniuse index eaadead..de3d789 100755 --- a/tools/mkcaniuse +++ b/tools/mkcaniuse @@ -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__