in reply to detecting file changes

I think you may be after the content of perldoc -q tail, which explictly also points to File::Tail, a module you may be interested in.