in reply to wait until something new is written to it
On LInux you can use Linux::Inotify2 and other modules based on inotify.