X-Git-Url: http://git.ieval.ro/?p=nethack-naodash.git;a=blobdiff_plain;f=lib%2FNetHack%2FNAOdash.pm;h=23383493431bc5563489f54301013242c9c4378f;hp=92f17ef6d2a79e408b845dd80d15ec031d14f132;hb=refs%2Ftags%2F0.002;hpb=49bfce9d5386b4c3b36b93b72475b0766dd83307 diff --git a/lib/NetHack/NAOdash.pm b/lib/NetHack/NAOdash.pm index 92f17ef..2338349 100644 --- a/lib/NetHack/NAOdash.pm +++ b/lib/NetHack/NAOdash.pm @@ -6,7 +6,7 @@ use warnings; use re '/saa'; use parent qw/Exporter/; -our $VERSION = '0.001'; +our $VERSION = '0.002'; our @EXPORT_OK = qw/naodash_xlog naodash_user/; our @EXPORT = @EXPORT_OK; @@ -126,7 +126,7 @@ sub _get_xlog { my $dir = $ENV{NAODASH_CACHE} || catdir tmpdir, 'naodash'; mkdir $dir or die "Cannot create cache directory: $!\n" unless -d $dir; my $file = catfile $dir, $name; - write_file $file, _get_xlog_from_server $name unless -f $file && time - (stat $file)[9] < 86400; + write_file $file, _get_xlog_from_server $name if ! -f $file || time - (stat $file)[9] >= 86_400; scalar read_file $file }