Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: Best way to pick apart log file.

by mkmcconn (Chaplain)
on Dec 27, 2001 at 22:45 UTC ( [id://134678]=note: print w/replies, xml ) Need Help??


in reply to Best way to pick apart log file.

Try inserting into your while loop:

next if m/^\s*$/;

It appears your code is failing because there are blank lines, or lines not delimited with ';'. Is that true?
mkmcconn
By the way, I really admire that line:
($dst, $service) = (split /;/)[11, 12];

Replies are listed 'Best First'.
Re: Re: Best way to pick apart log file.
by Rich36 (Chaplain) on Dec 27, 2001 at 23:00 UTC
    That probably is the case. I ran this with trailing blank lines and got the same error. When the blank lines are removed, the error goes away - even using strict and warnings.
    The other thing that got rid of another error was to actually define $count1 as $count1 = 0. Otherwise I got an error Use of uninitialized value in numeric ge (>=) at logtest.pl line 47 at the end of the code.
    Rich36
    There's more than one way to screw it up...

Re: Re: Best way to pick apart log file.
by dru145 (Friar) on Dec 27, 2001 at 23:21 UTC
    Yes, that is true, there are blank lines in the logs. I added your next statement and it worked like a champ.

    By the way, I really admire that line: ($dst, $service) = (split /;/)[11, 12];

    Thanks, but I can't take credit for it. It was suggested by a most excellent monk, Juerd, in this post Another Array Problem: comparing..

    -Dru
    Another satisfied monk

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (6)
As of 2024-04-19 17:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found