Skip to content

Instantly share code, notes, and snippets.

@smujohnson
Created October 30, 2012 17:40
Show Gist options
  • Save smujohnson/3981763 to your computer and use it in GitHub Desktop.
Save smujohnson/3981763 to your computer and use it in GitHub Desktop.
$datetext{string} = strftime "%Y-%B-%d (%A)", localtime;
sub isDateAlreadyWritten {
my $ret = 0;
my $bw = File::ReadBackwards->new($log_file);
until ($bw->eof) {
my $line = $bw->readline;
chomp($line);
if ($line eq $datetext{string}) { $ret = 1; last; }
}
$bw->close;
return $ret;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment