note
LanX
I don't understand your point (and I'm too much in a hurry ATM to investigate your code)<P><P>
Keys of a hash are always unique, in my code collisions of random numbers are simply ignored.<P><P>
<H5> update<P></H5><P>
<I>> That doesn't guarantee unique values.</I><P><P>
maybe this is clearer:<P><P>
<c>
DB<107> $seen{int rand 10}=1 for 1 .. 1000000
=> ""
DB<108> keys %seen
=> (6, 3, 7, 9, 2, 8, 1, 4, 0, 5)
</c><P><P>
<H5> update </H5>
one could argue that the <I>order</I> of hash -keys isn't random but that wasn't part of the question.<P><P>
Otherwise thats a good occasion to use <C>shuffle</C> or pushing into an array (but this implies reseeding rand every time)<P><P>
<!-- Node text goes above. Div tags should contain sig only -->
<div class="pmsig"><div class="pmsig-708738">
<p>Cheers Rolf
<p> <small>( addicted to the Perl Programming Language) </small>
</div></div>
1027065
1027141