From dfe0cbe22817910d2c942a891875fa95a2225584 Mon Sep 17 00:00:00 2001 From: Marius Gavrilescu Date: Sun, 7 Sep 2014 00:53:38 +0300 Subject: [PATCH] Switch to JSON::MaybeXS --- Makefile.PL | 1 + lib/App/MusicExpo.pm | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Makefile.PL b/Makefile.PL index baea04b..f49ecc6 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -15,6 +15,7 @@ WriteMakefile( HTML::Template::Compiled 0 Memoize 0 MP3::Tag 1.12 + JSON::MaybeXS 0 DB_File 0 Ogg::Vorbis::Header::PurePerl 0/, }, diff --git a/lib/App/MusicExpo.pm b/lib/App/MusicExpo.pm index 242e0df..ef99911 100644 --- a/lib/App/MusicExpo.pm +++ b/lib/App/MusicExpo.pm @@ -15,7 +15,7 @@ use DB_File qw//; use File::Basename qw/fileparse/; use Fcntl qw/O_RDWR O_CREAT/; use Getopt::Long; -use JSON; +use JSON::MaybeXS; use Storable qw/thaw freeze/; ################################################## @@ -129,7 +129,7 @@ sub run { push @files, \%entry } - my $json = JSON->new->utf8->canonical->encode({files => \@files, prefix => $prefix}); + my $json = JSON::MaybeXS->new(canonical => 1)->encode({files => \@files, prefix => $prefix}); $json =~ s//>/g; $ht->param(files=>[sort { $a->{title} cmp $b->{title} } @files], prefix => $prefix, json => $json); -- 2.39.2