in reply to saving the key of a hash

To save the key, try:

my $value = $_;
because $hash{$_} is the value of the array element, not the key.

--
tbone1, YAPS (Yet Another Perl Schlub)
And remember, if he succeeds, so what.
- Chick McGee