in reply to Re^3: trouble parsing log file...
in thread trouble parsing log file...
Your problem is here...
You are trying to match the string "DOWN" against the string "log.txt". Of course, that will never match :)
and here...$logfile="log.txt";
Can you see?if ($logfile =~ /$error/i) {
You are trying to match the string "DOWN" against the string "log.txt". Of course, that will never match :)
I think you want:
while (my $line = <LOG>) { if ($line =~ /$error/i) { etc....
Cheers,
Darren :)
In Section
Seekers of Perl Wisdom