Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
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 having an uproarious good time at the Monastery: (5)
As of 2017-02-20 07:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Before electricity was invented, what was the Electric Eel called?






    Results (294 votes). Check out past polls.