Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
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 :)


Comment on Re^4: trouble parsing log file...
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://585287]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (9)
As of 2014-09-02 17:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite cookbook is:










    Results (25 votes), past polls