Re: stupid perl question

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Matt Graham
Date:  
To: Main PLUG discussion list
Subject: Re: stupid perl question
From: "Steven A. DuChene" <>
> I really didn't think something like this would be that hard in perl. :-)


use File::Tail;
$file = File::Tail->new(
name=>"/home/mhgraham/bin/power_input_stuff.txt",
maxinterval=>5,
interval=>1,
tail=>-1
);
while (defined(my $line = $file->read)) {
    print $line;
}


The defaults are much longer than impatient people who are trying to write
stuff quickly may think :-) If you set them up as in the above, it should
take only a bit of time to see stuff show up. The defaults? Well, 10 or 20
seconds, if not longer. So: "perldoc File::Tail" and find all the parameters
and set them up appropriately for your thing....

--
Matt G / Dances With Crows
The Crow202 Blog: http://crow202.org/wordpress/
There is no Darkness in Eternity/But only Light too dim for us to see

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