trouble getting random item from array to display

Code:
sub{for(my($t,$i,%h,@r)=$_[1];;){$_=$_[0];1 while(/{([^{}]+)}/ and @r=split(/\|/,$1) and s/{\Q$1\E}/$r[rand @r]/);!exists $h{$_}&&$_[2]->($_)&&$h{$_}++;last if (keys %h)==$t || ++$i>$t*100;}}->($spinStr,10,sub{print $_[0],"\n"});
You win.
 


Wow this thread has epenis win written all over it.

Thanks for the code guys.