Hi there,
I want to check on multiple growing files but I really don't know how to do it.
I know "select()" is somehow related with my question but I cannot figure how to do it with the code bellow ...
I have a version of it using File::Tail but I really want to avoid it because I will need to compile it using PAR since the destination server does not have File::Tail and they dont let me install the module.
I also want to "uniq"!??! the fetched values. The thing will send emails if trigered but I only want to send 1 from ocurrence every 15 minutes. (thie one I dont know how even with File::Tail )
Many thanks
NMA
Code:
open (LOGFILE, $telcofile) or die "can't open $telcofile: $!";
for (; {
for ($curpos = tell(LOGFILE); <LOGFILE>; $curpos = tell(LOGFI
+LE)) {
print "Got Line!: $_";
}
sleep 1800;
seek(LOGFILE, $curpos, 0); # seek to where we had been
exit if (stat(LOGFILE))[3] == 0
}
close(LOGFILE) or die "can't close $telcofile:
I want to check on multiple growing files but I really don't know how to do it.
I know "select()" is somehow related with my question but I cannot figure how to do it with the code bellow ...
I have a version of it using File::Tail but I really want to avoid it because I will need to compile it using PAR since the destination server does not have File::Tail and they dont let me install the module.
I also want to "uniq"!??! the fetched values. The thing will send emails if trigered but I only want to send 1 from ocurrence every 15 minutes. (thie one I dont know how even with File::Tail )
Many thanks
NMA
Code:
open (LOGFILE, $telcofile) or die "can't open $telcofile: $!";
for (; {
for ($curpos = tell(LOGFILE); <LOGFILE>; $curpos = tell(LOGFI
+LE)) {
print "Got Line!: $_";
}
sleep 1800;
seek(LOGFILE, $curpos, 0); # seek to where we had been
exit if (stat(LOGFILE))[3] == 0
}
close(LOGFILE) or die "can't close $telcofile: