keys %in; #reset the iterator to the beginning of the hash my $firstkey = each %in; print MAIL "\t", $firstkey, " = \t", $in{$firstkey}, "\n"; #### my $firstkey = (sort(keys %in))[0];