use strict; use List::Util qw/shuffle/; my @imagearray = shuffle keys %db; my ($name,$url) = ($imagearray[0],$db[$imagearray[0]); print qq();