robinturner: (Default)
[personal profile] robinturner
Whenever I start to get upset at the trivia of my life, this kind of thing calms me down:

} else {
$testfile = $query->param('testchoice');

$testfile =~ s/Sublists/P/g;
$testfile =~ s/Multiple Choice/M/g;
$testfile =~ s/ /_/g;
$testfile = $filebase.$testfile.$extension;
open(FILE, "$testfile");
(@lines) = ;

# @questions = [];
@right = [];
@wrong = [];
foreach $line (@lines){

if ($line =~ /^Q/){
push (@questions, $line);

}
elsif ($line =~ /^\*/){
push @right, $line;
}
else {push @wrong, $line;}
}
for ( $i=0; $i<=@wrong; $i++) {
$x = $wrong[$i];
print $query->p("$x");
}

close(FILE);

Profile

robinturner: (Default)
Robin Turner

June 2014

M T W T F S S
      1
2345678
9101112131415
16171819202122
232425 26272829
30      

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags