in reply to Using 'keys' on a list

At 5 characters

my @keys = keys %{{f}};
is much more elegant than the equivalent
use List::Util qw( shuffle uniq pairkeys ); my @keys = shuffle uniq pairkeys f;
Remember that hashes do uniq'ing and shuffling for free :)

UPDATE: added a missed "keys" as LanX pointed out.

Replies are listed 'Best First'.
Re^2: Using 'keys' on a list
by LanX (Saint) on Jun 29, 2021 at 19:59 UTC
    >   my @keys = %{{f}};

    Did you mean:

      my @keys = keys %{{f}};

    ???

    Cheers Rolf
    (addicted to the Perl Programming Language :)
    Wikisyntax for the Monastery

      sure did, updated.

      Apparently. But that's exactly what the OP was using, so it doesn't help.

      Seeking work! You can reach me at ikegami@adaelis.com