sub get_std_test { die +(caller(0))[3].' cannot be called in void context' if not defined wantarray; local $/; # set our delimiter to nothing, slurp file my %config = mcas::get_config(); # returns a hash of all config vars my @questions; open QUESTIONS, 'questions' or die "Cannot open QUESTIONS file: $!"; my @questions = split "===\n", ; close QUESTIONS; while(@questions > $config{num_questions_per_test}) { splice @questions, int(rand(@questions)), 1; } die "\$count = $count, < num_questions_per_test config var" if (@questions < $config{num_questions_per_test}); return @questions; }