Re: stupid perl question

Top Page
Attachments:
Message as email
+ (text/html)
+ (text/plain)
Delete this message
Reply to this message
Author: Steven A. DuChene
Date:  
To: Kevin Fries, Main PLUG discussion list
Subject: Re: stupid perl question
body{font-size:10pt;font-family:arial,sans-serif;background-color:#ffffff;color:black;}p{margin:0px;}I am doing lots of processing of each line once I read it and sending it onto another utility.All of that code is already written in perl.I really didn't think something like this would be that hard in perl. :-)-----Original Message-----
From: Kevin Fries
Sent: Jun 23, 2011 4:21 PM
To: Main PLUG discussion list , "Steven A. DuChene"
Subject: Re: stupid perl question

Is there a reason the log scraper needs to be done in perl? There is autility that will read log files from the end called tac. Maybe it willhelp.Just a thought.KevinOn 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 addedto 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 thebasic concept will> work using File::Tail but when I run the example code below and add linesto 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 0100 00 00 50" >> power_input_stuff.txt>> but I am getting NOTHING back in the original window where the perl scriptis running.>> The above perl code is a near direct copy of the File::Tail example codeon cpan so I would expect it to work.>> What am I doing wrong???> --> Steven DuChene>>>> ---------------------------------------------------> PLUG-discuss mailing list - > To subscribe, unsubscribe, or to change your mail settings:> http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss


---------------------------------------------------
PLUG-discuss mailing list -
To subscribe, unsubscribe, or to change your mail settings:
http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss