I am processing a tree of files and I want to keep track of what file I have processed. So what I do is when I process a file I write the name of the file into a log.
The log is a straight text file with the full names of the files.
ie test1.txt
The program comes back with file not found.
use List::Util qw(first);
open (LOG, ">>$LogFileName")||die("Can not open Log file\n");
my ($FileProcessed) = first{$_ eq $FileName}<LOG>;
close(LOG);
if ($FileProcessed){
print("$FileName Found in Log file\n");
}else{
print("$FileName NOT Found in Log file\n");
}
Thanks
JGatrell42