my $data = decode_json($res->decoded_content) or die "Parse error: $!";
my $updated = eval {
s/ GMT$//,
- return Time::Piece->strptime($_)->ymd for $res->header('Last-Modified')
- } || time;
+ return Time::Piece->strptime($_) for $res->header('Last-Modified')
+ };
+ $data->{-date} = $_->datetime for $updated || ();
- open my $save, '>', (my $download = "browser-support-$updated.inc.pl");
+ my $suffix = $updated && $updated->ymd || time;
+ open my $save, '>', (my $download = "browser-support-$suffix.inc.pl");
print {$save} pp($data);
close $save;