I'm looking to increase the count $x every time a match is made for
the regex. Though I'm not having any luck nor am I receiving any
errors. I'm missing something, it seems $x++ would increase $x since
it starts at 0 by default?
http://www.doulos.com/knowhow/perl/quick_start/

my ( %srca );
my $x;

while (<LOG>) {
        next unless 
/Sig:\s*(\d+)\s+Subsig:\s*(\d+)\s+Sev:\s*(\d+)([^\[]+)\[([\d\.]+):(\d+)\s*->\s*([\d\.]+):(\d+)
/;
        $x++;
        print $x;
        $srca{ $5 } += $x;      
}

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


Reply via email to