use strict; open(HASH, "testhash.txt") || die; my $line = ; chomp $line; $line =~ s/'//g; my %hash = split(/,/, $line); print "\nEnter the keycode: "; chomp($line = ); print "Keycode $line has the value $hash{lc($line)}\n" if ($hash{lc($line)});