Help for this page
my @lines = <QUESTIONS>; # The entire file in an array my @questions = (); # A new array for questions ... } # and then to get the last one push(@questions,$tmp) if $tmp;
my @rand_questions = (); foreach (0 .. $num_questions_per_test) { my $rand = int(rand(scalar(@questions) - 1); push(@rand_questions,$questions[$rand]); }