One of the things you can do is to record the i-node number
after opening the file, and just prior to your
while (<LOG>) stat $log and check
whether it has the same i-node number. If it hasn't, the
log rotated, and you have to close and reopen LOG.
Thanks to both of you, with a special thanks to Abigail. I have an innate ability to overcomplicate everything I do. Thanks for pulling me back to earth ;-)