Subject: | tail => 0 contructor arg not working correctly |
If I am reading the documentation correctly, setting the tail constructor arg to zero should have it only look at *new* content in the file. But if I run the example below using v1.3 on Debian linux it immediately matches if the last existing line of the log file already has "new info" in it. In other words, nothing was added to the file but it still matched. Thanks.
use File::Tail;
my $file = File::Tail->new(
name => 'test.log',
maxinterval => 1,
tail => 0,
);
while (defined(my $line=$file->read)) {
last if $line =~ /new info/;
}
say "got match";