Improved test_watcher.pl from similar script