in reply to Reopen file when contents changed?
I'm not completely sure, but I think you should take a look at the Tie::File module. It allows you to treat a file like an array. Then you could just keep reading the first item in the array. Here's what it looks like:
Tie::File Documentation
The @data array would then contain the contents of the file, one entry per line. You could then just read $data[0], which would be the first line of the file. I think that it would update dynamically.use Tie::File; ... tie @data, Tie::File, $filename or die "Can't tie to $filename :$!\n";
Tie::File Documentation
In Section
Seekers of Perl Wisdom