X-Git-Url: http://git.ieval.ro/?a=blobdiff_plain;f=lib%2FApp%2FMusicExpo.pm;h=e9c0b9579e5556e2839a860ce2aa727ec46bf549;hb=cc5d06b5c1cb910dd20e39a43a399dd1652f926d;hp=ef99911562494db12f098cdc34bd9016ce0d12bd;hpb=dfe0cbe22817910d2c942a891875fa95a2225584;p=app-musicexpo.git diff --git a/lib/App/MusicExpo.pm b/lib/App/MusicExpo.pm index ef99911..e9c0b95 100644 --- a/lib/App/MusicExpo.pm +++ b/lib/App/MusicExpo.pm @@ -3,7 +3,7 @@ use v5.14; use strict; use warnings; -our $VERSION = '0.003002'; +our $VERSION = '0.003003'; use Audio::FLAC::Header qw//; use HTML::Template::Compiled qw//; @@ -98,10 +98,10 @@ sub normalizer{ } sub run { - tie my %cache, 'DB_File', $cache, O_RDWR|O_CREAT, 0644 unless $cache eq ''; - memoize 'flacinfo', NORMALIZER => \&normalizer, LIST_CACHE => 'MERGE', SCALAR_CACHE => [HASH => \%cache] unless $cache eq ''; - memoize 'mp3info' , NORMALIZER => \&normalizer, LIST_CACHE => 'MERGE', SCALAR_CACHE => [HASH => \%cache] unless $cache eq ''; - memoize 'vorbisinfo' , NORMALIZER => \&normalizer, LIST_CACHE => 'MERGE', SCALAR_CACHE => [HASH => \%cache] unless $cache eq ''; + if ($cache) { + tie my %cache, 'DB_File', $cache, O_RDWR|O_CREAT, 0644; + memoize $_, NORMALIZER => \&normalizer, LIST_CACHE => 'MERGE', SCALAR_CACHE => [HASH => \%cache] for qw/flacinfo mp3info vorbisinfo/; + } my %files; for my $file (@ARGV) {