in reply to Counting lines starting with a unique string
open(FILE,"whatever.log"); my %seen = (); while(my $line = <FILE>){ my ($first) = ($line =~ /^(/S+)/)[0]; $seen{$first}++; } print scalar keys %seen; [download]