I am starting to work on a script that is going to take my RADIUS Detail file, and 
dump it into a mySQL database.

I can get it to run once and hour or anytime via cron, but I want something real-time, 
that would be pretty much always running as a process / server.

Using the "open (myFile, "detail")" works, but I only know how to get the current 
contents, and once that is finished, it will exit.

So, I have something like

open (myFile, "/var/log/radacct/default/detail") or die "Can't open the Accounting 
file";

while ($line = <myFile>)
{
yada yada yada;
}

So ... I was thinking, if I add an other loop to that (outside of the while), would 
that work?  Or does Perl offer a way to consintately read a dynamic file?  

Basically, once I read the contents, I want to kill the file so that it does not 
expain.  I can do it via a cron job, but that stops it from being real time, and right 
now that is what I want.

Can anyone give me some insight into this?

Thanks!

Brian

Reply via email to