Is there a reason the log scraper needs to be done in perl? There is a utility that will read log files from the end called tac. Maybe it will help. Just a thought. Kevin On Jun 23, 2011 5:17 PM, "Steven A. DuChene" wrote: > I am attempting to do a "tail -f" on a log file that has a new line added to it every 15 seconds. > I need to parse and process each new line as it is added to the file. > > I am trying to use the following example code from cpan to see if the basic concept will > work using File::Tail but when I run the example code below and add lines to the file > I get nothing out. > > #!/usr/bin/perl > > use File::Tail; > $file = File::Tail->new("/home/sad/bin/power_input_stuff.txt"); > while (defined(my $line = $file->read)) > { > print $line; > } > > > I am doing the following in another xterm window to add lines to the file: > > echo "2011:06:21:15:07:46 57 01 00 a0 04 a0 00 c3 00 a7 00 33 16 01 4e 01 00 00 00 50" >> power_input_stuff.txt > > but I am getting NOTHING back in the original window where the perl script is running. > > The above perl code is a near direct copy of the File::Tail example code on cpan so I would expect it to work. > > What am I doing wrong??? > -- > Steven DuChene > > > > --------------------------------------------------- > PLUG-discuss mailing list - PLUG-discuss@lists.plug.phoenix.az.us > To subscribe, unsubscribe, or to change your mail settings: > http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss