in reply to Last Element of Hash
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.
|
|---|