my $r = int(rand(keys %db)); my $i = 0; foreach (keys %db) { if($r == $i){ print qq(<a href="$_"><img src="/images/$db{$_}"></a>); last; } $i++; }
- Tom
In reply to Re: converting hash to shuffled array
by tcf22
in thread converting hash to shuffled array
by sulfericacid
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |