in reply to Re: Delete all hash keys except for n of them
in thread Delete all hash keys except for n of them

Even better!
%a = (%a)[0 .. $n-1];
Gautam

Replies are listed 'Best First'.
Re^3: Delete all hash keys except for n of them
by Anonymous Monk on Oct 26, 2004 at 00:54 UTC
    Not only did I not see the code posted earlier, it was wrong too. Doh!
    %a = (%a)[0 .. $n*2-1];