in reply to First Value in hash
but since hashes are not ordered (unless tied to some class that enforces some ordering), which key is "first" isn't very meaningful.keys %in; #reset the iterator to the beginning of the hash my $firstkey = each %in; print MAIL "\t", $firstkey, " = \t", $in{$firstkey}, "\n";
If you meant the key that sort makes be first,
is one way.my $firstkey = (sort(keys %in))[0];
|
|---|