BackPAN-Version-Discover

 view release on metacpan or  search on metacpan

lib/BackPAN/Version/Discover/_BackPAN/Index.pm  view on Meta::CPAN

    return Path::Class::file($file);
}


sub _backpan_index_has_changed {
    my $self = shift;

    my $file = $self->_backpan_index_file;
    return 1 unless -e $file;

    my $local_mod_time = stat($file)->mtime;
    my $local_age = time - $local_mod_time;
    return 0 unless $local_age > $self->cache->ttl;

    # We looked, don't have to look again until the ttl is up.
    $self->_backpan_index_file->touch;

    my(undef, undef, $remote_mod_time) = head($self->backpan_index_url);
    return $remote_mod_time > $local_mod_time;
}



( run in 1.261 second using v1.01-cache-2.11-cpan-49f99fa48dc )