Always always always:

use strict;
use warnings;

Sorry, i just used (...) to indicate that i left out some lines of code. Including use strict, use warnings and all initialisations.



Then how did the code you posted work? Non of it was initialized with the scope it should have been. (IE any of the places I added 'my' to in my previous email.


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?


Thought it would be safer, because some ip-adresses have multiple file entries. But i guess it's not necessary.

Don't you want the total for each IP from all the files?

I'm still not sure where you where put all the log files into one ans still "already did it that way" like you said in the previous email.


-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>




Reply via email to