Switch to JSON::MaybeXS
[app-musicexpo.git] / lib / App / MusicExpo.pm
index 32715ae1680671c029729fa65b99f926670be995..ef99911562494db12f098cdc34bd9016ce0d12bd 100644 (file)
@@ -3,7 +3,7 @@ use v5.14;
 use strict;
 use warnings;
 
-our $VERSION = 0.003001;
+our $VERSION = '0.003002';
 
 use Audio::FLAC::Header qw//;
 use HTML::Template::Compiled qw//;
@@ -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/</&lt;/g;
        $json =~ s/>/&gt;/g;
        $ht->param(files=>[sort { $a->{title} cmp $b->{title} } @files], prefix => $prefix, json => $json);
@@ -156,6 +156,8 @@ HTML
 
 __END__
 
+=encoding utf-8
+
 =head1 NAME
 
 App::MusicExpo - script which generates a HTML table of music tags
@@ -204,7 +206,7 @@ Marius Gavrilescu, E<lt>marius@ieval.roE<gt>
 
 =head1 COPYRIGHT AND LICENSE
 
-Copyright (C) 2013 by Marius Gavrilescu
+Copyright (C) 2013-2014 by Marius Gavrilescu
 
 This library is free software; you can redistribute it and/or modify
 it under the same terms as Perl itself, either Perl version 5.14.2 or,
This page took 0.010328 seconds and 4 git commands to generate.