Replace DATA with <> or whatever file handle you love.
use strict; use warnings; my %ips = (); map { $ips{ join('.',(split('\.',$_,4))[0..2] ) }++ } <DATA>; print "$_ has $ips{$_} nodes\n" foreach sort keys %ips; __DATA__ 10.10.10.1 10.10.10.2 10.10.10.3 10.10.12.1
In reply to Re: Summarizing an array of IP's
by exussum0
in thread Summarizing an array of IP's
by carric
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |