my $last = (keys %hash)[-1]; foreach my $element (keys %$hash) { if ($element eq $last) { #do this } else { #do that } }
I just added this as just something to play with. I don't think I'd ever use it in production code myself.
In reply to Re: Last Element of Hash
by bart
in thread Last Element of Hash
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |