Use JSON::MaybeXS instead of JSON (courtesy of Ethan Rooke)

This commit is contained in:
Dianne Skoll
2022-01-22 18:09:02 -05:00
parent b22438b489
commit 86873d0725
2 changed files with 3 additions and 3 deletions

View File

@@ -7,7 +7,7 @@ bindir=@bindir@
datadir=@datadir@
datarootdir=@datarootdir@
PERL=@PERL@
PERLMODS_NEEDED=JSON::Any Getopt::Long
PERLMODS_NEEDED=JSON::MaybeXS Getopt::Long
all:
true

View File

@@ -4,7 +4,7 @@ use strict;
use warnings;
use Getopt::Long;
use JSON::Any;
use JSON::MaybeXS;
my %Options;
@@ -266,7 +266,7 @@ sub parse_input
($y, $m, $d, $special, $tag, $duration, $time, $body) =
($1, $2, $3, $4, $5, $6, $7, $8);
} elsif (/\{/) {
my $obj = JSON::Any->jsonToObj($_);
my $obj = decode_json($_);
next unless ($obj->{date} =~ /^(\d+)-(\d+)-(\d+)$/);
$y = $1;
$m = $2;