my %hash; while(my $line=<>){ chomp $line; chop $line; $hash{$line}++; } print %hash;