in reply to Re: Checking multiple files..
in thread Checking multiple files..

Hi there, thanks for your answer.
I do have a complete version of my question that I setuped using the File::Tail examples, but I was trying to avoid it because for that I need to compile an executable with PAR wich makes a huge bin file (I dont have permission to setup the File::Tail module on the destination server)... oh well!..
Wont the incomplete line be caugth on the next cycle? Need to do a bit to bit count?!
So if I need to get stuck with the code bellow how can I do and "uniq" ou the fectched regex values on "$_->read;"

Best Regards,

#!/usr/bin/perl use warnings; use strict; use File::Tail; my $ConfFile="watchtelecom.conf"; my @LogFiles; my @Files; my $nfound; my $timeleft; my @pending; my $timeout; my $ErrorPatern="error"; #testing purpuses. #my $ErrorPatern="Input: Error reading in input stream"; my $test; my $x; open(CONFFILE, "$ConfFile") or die("Could not open $ConfFile."); foreach (<CONFFILE>) { push(@LogFiles,$_); } close(CONFFILE) or die("Could not close $ConfFile."); foreach (@LogFiles) { push(@Files,File::Tail->new(name=>"$_", maxinterval=>1800)); } while (1) { ($nfound,$timeleft,@pending)= File::Tail::select(undef,undef,undef,$timeout,@Files); foreach (@pending) { my $telcoline=$_->read; if ($telcoline =~ /$ErrorPatern/) { #print $_->{"input"}." (".localtime(time).") ".$_->read; if ($_->{"input"} =~ /TMN/) { print "Via Vodafone: $telcoline"; $test=$telcoline; } else { print "Via TMN: $telcoline"; $test=$telcoline; } } } }