in reply to Type of arg 1 to splice must be array (not keys)

why splice ? :-)
my $max = 100; my @list = grep $max-- > 0, keys %hash;

Replies are listed 'Best First'.
Re^2: Type of arg 1 to splice must be array (not keys)
by kikuchiyo (Hermit) on Dec 14, 2009 at 22:29 UTC
    If you format that like this:
     $max --> 0
    it looks like as if there was a "$max goes to zero" operator.

    A great way to confuse anybody who reads your code.
      Would you prefer --$max >= 0?