perlquestion
deprecated
I run two services which produce log files on the scale of multigigabytes: [http://www.postgresql.org/|Postgres] and [http://opennap.sourceforge.net/opennap]. Taking huge zipped up tarballs of these logs and parsing them during off hours or when I come home from work gets tedious. I'd rather just have a perl daemon set up that actually read them as they were generated and stuffed em in a database in the format I want.
<p>
So the approach I came up with was using mkfifo(1) and this eensy-weensy loop:
<code>
#!/usr/local/bin/perl
open FIFO, "<foo" or die "$!\n";
while (<FIFO>) {
chomp;
print "$_\n";
}
</code>
The problem is, this doesnt actually stay open and alive. It dies after the first "<code>echo 'hello' > foo</code>".
<p>
Is there a way I can make perl "listen" to a file and actually have it be parsing data and doing inserts on a db?
<p>
thanks,
<br>
brother [deprecated|dep].
<p>--
<br><a href="http://www.tillymonks.org/">Laziness, Impatience, Hubris, and <i>Generosity</i></a>.