This file is a direct dump of data I am looking at.
My snippet of code looks like:
... # Setup our IP matching regex my $re_ip = qr/(\d+\.\d+\.\d+\.\d+):\d+/; my $re_test = qr/^\s*$re_ip\s*->\s*$re_ip\s*->\s* $re_ip/x; my $re_line = qr/ ^ \s* $re_ip \s* -> \s* $re_ip \s* -> \s* $re_ip /x; ... # Reset data my @connections = `bigpipe conn dump`; ... foreach my $line (@connections) { print "$line\n" if ($line =~ /$re_test/); $vip{$2}{'conn_count'}++ if ($line =~ /$re_line/); }
The print statement works as expected; the increment does not. The increment counter works immediately if I change it to if ($line =~ /$re_test/);
Thanks again for all the help.
<-> In general, we find that those who disparage a given operating system, language, or philosophy have never had to use it in practice. <->
In reply to Re: Re: Matching IP address continued
by ibanix
in thread Matching IP address continued
by ibanix
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |