perl example code to monitor log