the thing is there are nine categories of questions, Question 1, Question 2... so i want 5 random questions from each of the nine categories.
: Hi,
:
: Different context, same solution. Time for my random array element selection one-liner again.

:
: Put all your questions in @questions - one question in each array element (that's what you're doing now, I think). Then do this:-
:
: @chosen = grep {$::z++ < 5} sort { int(rand() * 2) } @questions, $::z = 0;
:
: @chosen will contain 5 questions out of @questions, randomly selected. If you're not sure how it works, here's the explanation I posted last time I pulled this one out:-
:
: http://www.programmersheaven.com/c/MsgBoard/read.asp?Board=12&MsgID=218626&Setting=A9999F0003
:
: Hope this helps,
:
: Jonathan
:
: ###
: for(74,117,115,116){$::a.=chr};(($_.='qwertyui')&&
: (tr/yuiqwert/her anot/))for($::b);for($::c){$_.=$^X;
: /(p.{2}l)/;$_=$1}$::b=~/(..)$/;print("$::a$::b $::c hack$1.");
:
: