Always always always:
use strict;
use warnings;
(...)
foreach $file (@sortlist){
my @sortlist = ...
my %ipload =();
foreach my $file (@sortlist) {
open(LOG,$file) or die "Can't open $file: $!\n";
@lines = <LOG>;
my @lines = <LOG>;
foreach my $logline (reverse(@lines)) {
#Search for Host-IP-Adress and bytes
if( $logline =~ / (\d+\.\d+\.\d+\.\d+) \w*\/\w* (\d+) [A-Z]+/ ){
if($ipload{$1}) {$ipload{$1}+=$2}
else {$ipload{$1}=$2}
Wht not just
$ipload{$1} += $2;
instead of the if else?
}
}
#Close log file
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>