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.
In reply to Re^3: Search a hash case insensitive
by kennethk
in thread Search a hash case insensitive
by Saved
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |