Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
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?
[Discipulus]: ther is a way to golf this further:if(p$_)&(p $r)&$r!=$_ ?
[Discipulus]: being $r the reverse of $_

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (5)
As of 2017-10-20 07:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My fridge is mostly full of:

















    Results (259 votes). Check out past polls.

    Notices?