idle has asked for the wisdom of the Perl Monks concerning the following question:
Log look like that:while (<LOG>){ my ($source, $sport, $to, $dport, $proto, $packs, $bytes) = sp +lit; if ( $total{"$source$dport"}{'from'} ) { # if source exist $connects{"$source$dport"}++; if ($total{"$source$dport"}{'to'}) { # and destination + exist - summarizing $total{"$source$dport"}{'bytes'}+=$bytes; } else { print "oops"; } # this seem we can't get here, +but I don't get why... } else { $total{"$source$dport"} = { "from" => $source, "to" => +"$to:$dport", "bytes" => $bytes } } $total+=$bytes; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How to save memory, parsing a big file.
by dragonchild (Archbishop) on Mar 01, 2006 at 15:17 UTC | |
by perl_devel (Friar) on Mar 02, 2006 at 11:07 UTC | |
by dragonchild (Archbishop) on Mar 02, 2006 at 14:25 UTC | |
|
Re: How to save memory, parsing a big file.
by BrowserUk (Patriarch) on Mar 01, 2006 at 16:20 UTC | |
|
Re: How to save memory, parsing a big file.
by mirod (Canon) on Mar 01, 2006 at 15:21 UTC | |
by dragonchild (Archbishop) on Mar 01, 2006 at 17:21 UTC | |
|
Re: How to save memory, parsing a big file.
by duff (Parson) on Mar 01, 2006 at 15:28 UTC | |
|
Re: How to save memory, parsing a big file.
by graff (Chancellor) on Mar 02, 2006 at 03:02 UTC | |
|
Re: How to save memory, parsing a big file.
by salva (Canon) on Mar 02, 2006 at 10:00 UTC | |
|
Thanks everyone.
by idle (Friar) on Mar 03, 2006 at 08:16 UTC |