in reply to Last Element of Hash

This will not load all the keys in memory, which may make sense for large hashes:
my $last = each %hash; while (defined $last) { my $next = each %hash; if (defined $next) { # $last is now set, but is _not_ the last, do what you want with it } else { # $last is now _the_ last, do what you want with it. } $last = $next; }

Liz

Update:
Removed next;, leftover from a previous version, not needed with this approach.