in reply to Current time as variable?

In the part where you have the form, you could try
print $cgi->hidden('time',time);
then in the other part
my $time=time-param('time');
that gives you the number of seconds as a decimal. then you can do
print $cgi->h2(sprintf("It took you %02d:%02d to take the quiz.",int($ +time/60),int($time%60)));
Hope this helps.