in reply to Pulling random elements from hash
Yet another way to do it:
print $hash{$_} for (sort {rand() <=> 0.5} keys %hash)
§ George Sherston
print $hash{$_} for (sort {rand() <=> 0.5} keys %hash)
§ George Sherston
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: Pulling random elements from hash
by ihb (Deacon) on Jun 22, 2003 at 23:21 UTC | |
Re^2: Pulling random elements from hash
by Aristotle (Chancellor) on Jun 30, 2003 at 20:42 UTC |
In Section
Seekers of Perl Wisdom