#!/usr/bin/perl -w %totals = (), %hwsum = (), %hwtimes = (); while ($line = ) { chomp $line; ($student, $assign, $grade) = split /:/, $line; $totals{$student} += $grade; $hwsum{$assign} += $grade; $hwtimes{$assign} += 1; $average{$assign} = $hwsum{$assign} / $hwtimes{$assign}; } @all = keys %totals; @all = sort {$totals{$b} <=> $totals{$a}} @all; @hwall = keys %average; @hwall = sort (%average); print "*** STUDENT TOTALS ***\n"; foreach $st (@all) { print $st, ": ", $totals{$st}, "\n"; } print "*** HOMEWORK AVG ***\n"; foreach $phw (@hwall) { print $phw, ": ", $average{$phw}, "\n"; } #### *** STUDENT TOTALS *** cindy: 24 david: 19 alice: 15 bob: 11 *** HOMEWORK AVG *** Use of uninitialized value in print at ./hw3.pl line 30, line 9. 7: Use of uninitialized value in print at ./hw3.pl line 30, line 9. 8: Use of uninitialized value in print at ./hw3.pl line 30, line 9. 8: hw1: 8 hw2: 8 hw3: 7