in reply to Re: How to print the 10 most recent (epoch) keys in a hash when epoch is not the key
in thread How to print the 10 most recent (epoch) keys in a hash when epoch is not the key

delete $hash{ pop @epochOrderKeys } while @epochOrderKeys > 10;
can also be written as
$#epochOrderKeys = 9 if $#epochOrderKeys > 9;

It doesn't remove the records from %hash, but there's no need to. The following would proceed to remove them if so desired:

%hash = @hash[ @epochOrderKeys ];
  • Comment on Re^2: How to print the 10 most recent (epoch) keys in a hash when epoch is not the key
  • Select or Download Code