I think there might be some RADIUS-specific modules out there that you might
want to check into as well.

-----Original Message-----
From: Brian Smith
To: [EMAIL PROTECTED]
Sent: 4/13/02 11:44 AM
Subject: Re: Reading an always changing in real time.

I found it ... never mind! :)

open (GWFILE, "brian");
for (;;)
{
for ($curpos = tell(GWFILE); <GWFILE>; $curpos = tell(GWFILE))
{
print $_;
# search for some stuff and put it into files
}
# sleep for a while
seek(GWFILE, $curpos, 0);  # seek to where we had been
}

Amazing what happens when one finds where to search :-)

~Brian.

 ----- Original Message -----
From: "Brian Smith"
To: <[EMAIL PROTECTED]>
Sent: Saturday, April 13, 2002 1:30 PM
Subject: Reading an always changing in real time.


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



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


--------------------------------------------------------------------------------
This email may contain confidential and privileged 
material for the sole use of the intended recipient. 
If you are not the intended recipient, please contact 
the sender and delete all copies.

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to