App-Wallflower
view release on metacpan or search on metacpan
lib/App/Wallflower.pm view on Meta::CPAN
}
# returns a boolean indicating if the update can be trusted
sub _update_todo {
my ($self) = @_;
my $todo = $self->{todo};
my $TODO = $self->{_ipc_dir_}->child('__TODO__');
my $SEEN = $self->{_ipc_dir_}->child('__SEEN__');
return if !-e $TODO;
my $certainty = # this update can be trusted if __TODO__ is the
( stat $TODO )[9] > max( 0, map +(stat)[9] || 0, # most recent
$SEEN, glob $self->{_ipc_dir_}->child('todo-*')); # file of all
# read from the shared todo
open my $fh, '<', $TODO or die "Can't open $TODO: $!";
@$todo = <$fh>;
chomp(@$todo);
return $certainty;
}
sub _next_todo {
my ($self) = @_;
my $seen = $self->{seen};
my $todo = $self->{todo};
my $next;
if ( $self->{option}{parallel} ) {
( run in 0.285 second using v1.01-cache-2.11-cpan-d6f9594c0a5 )