Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
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 drinking their drinks and smoking their pipes about the Monastery: (12)
As of 2015-07-28 20:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (259 votes), past polls