I'm using the perl File::Tail library to tail the output of a file and parse it's output.
Everything's working fine except there seems to be about a 10 second delay after I start the script before it starts outputting. After the first read, it works fine and all output is instantaneous. All of the writes during the delay seem to be outputted once it starts working, so I'm not losing any data. I don't think it has nothing to do with the file I'm reading because running a regular "tail -f" works instantly.
Heres the entire script:
#!/bin/perl
use File::Tail;
$file=File::Tail->new("file.txt");
while (defined($line=$file->read)) {
print "$line\n";
}
I copied this from an example somewhere online. I'm not very familiar with perl or File::Tail I'm hoping I'm doing something wrong. Any help would be appreciated.