user786 has asked for the wisdom of the Perl Monks concerning the following question:
I need to tail a log file as i run some commands on a cisco router. I used perl cpan File::Tail module.
my $file = File::Tail->new("logs/nameoflogfile"); while(defined(my $line = $file->read)) { print "$line\n"; }
I get the following error : Error opening "filename" No such file or directory
Checked the following1)File exists -->yes 2) Name of the file is correct, Path is correct.-->yes 3)I tried to tail a different file with the same script in my local host(not in router) it worked. 4)However on the router# it doesn't work. Any suggestions ?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: perl File::tail log files.
by aitap (Curate) on Jun 21, 2014 at 05:20 UTC | |
|
Re: perl File::tail log files.
by Anonymous Monk on Jun 21, 2014 at 08:53 UTC | |
by user786 (Sexton) on Jun 21, 2014 at 16:25 UTC | |
by parv (Parson) on Jun 21, 2014 at 23:29 UTC | |
|
Re: perl File::tail log files.
by 1s44c (Scribe) on Jun 23, 2014 at 21:58 UTC |