Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^4: trouble parsing log file...

by McDarren (Abbot)
on Nov 21, 2006 at 16:04 UTC ( #585287=note: print w/replies, xml ) Need Help??


in reply to Re^3: trouble parsing log file...
in thread trouble parsing log file...

Your problem is here...
$logfile="log.txt";
and here...
if ($logfile =~ /$error/i) {
Can you see?
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 :)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://585287]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (4)
As of 2017-04-30 12:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I'm a fool:











    Results (537 votes). Check out past polls.