App-perldolicious

 view release on metacpan or  search on metacpan

bin/perldolicious  view on Meta::CPAN


    close $fh or die "Could not close '$config_file': $!";
    return Mojo::JSON->new()->decode($bytes);
}

helper setup_modules_file => sub {
    my $cache_file = app->config('modules_cache_file');
    my $limit      = app->config('auto_download');

    die "Configuration auto_download: $limit doesn't look like number\n"
      unless Scalar::Util::looks_like_number($limit);

    # file does not exist or file exists but it's older than the
    # specified limit (in days)
    if (not -f $cache_file
        or -f $cache_file and -M $cache_file > $limit)
    {

        if (-f $cache_file) {
            app->log->info("Deleting cache file $cache_file");
            unlink $cache_file or die $!;



( run in 0.549 second using v1.01-cache-2.11-cpan-64827b87656 )