in reply to Summarizing an array of IP's

Update: Or replace with whatever array you love too :)

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

Play that funky music white boy..