Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
I was going to write some code to tail a log file and detect when it rolled and then close/reopen it. Then I saw a reference to File::Tail and it sounded like just what I want. So I thought I'd try something very simple. I literally copied the sample usage script, pointed it to a file called /tmp/xxx with a few lines in it and nothing happens! I tried to echo some additional lines to the file they're not reported either. Could there be some versioning thing going on? I'm running perl 5.8.8 and File::Tail 0.99.3.
When I run it there is no output. I even put a print right after the first call to make sure it gets to the while line and it does. Any ideas what I could try to see what's wrong? I even tried eliminating the while and simply doing the read since I know there's something in the file: and when I run it, it seems to be hanging on the read. The doc says you can pass it a non-zero value for debug so I tried 99 and got nothing. It feels like the file isn't getting opened but I have no ideas why. Finally I tried getting even more creative with more instrumentation as well as some error handling. It now looks like $! is getting set to "Inappropriate ioctl for device", but only when I report it with ERROR2 and not ERROR1. Is that message even real? In other words the constructor doesn't seem to be failing. I'm real confused by what I'm seeing. -mark
|
|