in reply to Re^2: Search a hash case insensitive
in thread Search a hash case insensitive

This is tangentially discussed in How can I remove duplicate elements from a list or array?, a perlfaq. You can construct your hash, and output whenever you hit a duplicate:

my %seen; while (my $line = <PFILE>) { @ID = split(/:/, $line); my $id = $ID[0]; if ($seen{lc($id)}++) { print "'$id' is duplicate\n"; } }

Note you had incorrect syntax for accessing a list element. I would also recommend against using variables with the same character sequence but different cases for names.