Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Parsing a log file

by graff (Chancellor)
on Nov 27, 2007 at 19:15 UTC ( #653344=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    while (<INPUT>) {
        my ( $msg ) = ( /msg=(.*?) Src \d+ / );
        # do something with $msg...
    }
    
  2. or download this
    while (<INPUT>) {
        next unless ( s/^([\d-]+)\s+([\d:]+)\s+(\S+)\s+// );
    ...
    
        # do stuff with %flds and other vars...
    }
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (3)
As of 2021-02-28 04:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?