# Extract and display a summary of information from the form. my @days = qw(Monday Tuesday Wednesday Thursday Friday Saturday Sunday); foreach my $day (@days) { my @times = $request->param($day); # Count the number of days the user selected something if(scalar @times) { $count += @times; } # Pretty up time times foreach(@times) { s/(\d{1,2}[ap])(\d{1,2}[ap])/\1-\2/; s/(a|p)/\1m/g; } # Display the list for each day $page .= "$day: " . (scalar @times == 0 ? "None" : "@times") . $request->br(); } # Show the total number of hours selected in the summary $page .= $request->p() . "Total Hours Selected: $count" . $request->p();