in reply to Counting lines starting with a unique string

well it's more than one line but should print the number of unique lines(untested)
open(FILE,"whatever.log"); my %seen = (); while(my $line = <FILE>){ my ($first) = ($line =~ /^(/S+)/)[0]; $seen{$first}++; } print scalar keys %seen;