http://qs321.pair.com?node_id=464312


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:
use Tie::File; ... tie @data, Tie::File, $filename or die "Can't tie to $filename :$!\n";
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.

Tie::File Documentation