in reply to Why is this code not printing hash key?

Umm... because in these lines:

if ($key eq $selection) { print "\n";

you’re just printing a newline, but not the key?

BTW, instead of the foreach loop I would say:

if (exists $hash{$selection}) { print "\n$selection\n"; } else { print "\nThe domain you entered is not on the list above. Now exi +ting script.\n"; exit; }

Hope that helps,

Athanasius <°(((><contra mundum Iustus alius egestas vitae, eros Piratica,