From: Marius Gavrilescu Date: Sat, 6 Sep 2014 21:53:38 +0000 (+0300) Subject: Switch to JSON::MaybeXS X-Git-Tag: 0.003003~1 X-Git-Url: http://git.ieval.ro/?p=app-musicexpo.git;a=commitdiff_plain;h=dfe0cbe22817910d2c942a891875fa95a2225584 Switch to JSON::MaybeXS --- 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);