open (TAIL, "logfile.log"); seek (TAIL, 0, 2); # check the manpage for (;;) { sleep 1; # so we don't hog cpu if (seek(TAIL,0,1)) { while () { # code to act on logfile here } } # execution continues here }