cotarelo has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl #use strict; open(TEXT,"dump.txt")or die("Text not found"); while (<TEXT>) { if ( /IP\s+(\d+\.\d+\.\d+\.\d+)(\.(\d+))?\s+>\s+(\d+\.\d+\.\d+\.\d +++)(\.(\d+))?\:\s+(\w+)/ ) { my ($srcip, $srcport, $dstip, $dstport, $proto) = ($1, $3, $4 +, $6, $7); printf "%16s [%5d] --> %16s [%5d] (%s)\n", $srcip, $srcport, +$dstip, $dstport, lc($proto); } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: array of arrays of hashes
by keszler (Priest) on Nov 16, 2009 at 13:29 UTC | |
by cotarelo (Initiate) on Nov 17, 2009 at 10:05 UTC | |
|
Re: array of arrays of hashes
by apl (Monsignor) on Nov 16, 2009 at 12:58 UTC | |
|
Re: array of arrays of hashes
by graff (Chancellor) on Nov 17, 2009 at 01:01 UTC | |
by cotarelo (Initiate) on Nov 17, 2009 at 10:02 UTC |