I need to tail a log file as i run some commands on a cisco router.
Do you change directory anywhere in your script? Try inserting
use Cwd; print getcwd(), "/logs/nameoflogfile ", (-e getcwd()."/logs/nameoflogfile" ? "exists" : "does not exist"), "\n" before the place where you open the file.
I tried to tail a different file with the same script in my local host(not in router) it worked.
Does this mean that you need to tail a log file on the remote host (CISCO router)? That could be a bit difficult.