patmis has asked for the wisdom of the Perl Monks concerning the following question:

I've already found some informations how to get random keys of a hash but how can I use this in a for, foreach or while statement?

Replies are listed 'Best First'.
Re: hash random keys
by davorg (Chancellor) on Jul 23, 2009 at 10:14 UTC

    What have you tried? What problems are you having?

    You'll get better help on Perl Monks if you show evidence of having tried to solve the problem yourself first.

    You say that you know how to get a list of the random keys, so why not do something like this:

    foreach (@list_of_random_hash_keys) { # do something interesting with $_ which will # contain a random hash key }
    --

    See the Copyright notice on my home node.

    Perl training courses