--- loncom/interface/spreadsheet/studentcalc.pm 2003/08/01 13:33:41 1.16 +++ loncom/interface/spreadsheet/studentcalc.pm 2003/09/05 01:06:45 1.17 @@ -1,5 +1,5 @@ # -# $Id: studentcalc.pm,v 1.16 2003/08/01 13:33:41 matthew Exp $ +# $Id: studentcalc.pm,v 1.17 2003/09/05 01:06:45 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -45,6 +45,9 @@ studentcalc ################################################### package Apache::studentcalc; +use warnings FATAL=>'all'; +no warnings 'uninitialized'; + use strict; use Apache::Constants qw(:common :http); use Apache::lonnet; @@ -98,8 +101,8 @@ sub initialize_sequence_cache { } sub clear_package { - @Sequences = undef; - %Exportrows = undef; + undef(@Sequences); + undef(%Exportrows); } sub get_title { @@ -493,7 +496,7 @@ sub compute { sub set_row_sources { my $self = shift; while (my ($cell,$value) = each(%{$self->{'formulas'}})) { - next if ($cell !~ /^A(\d+)/ && $1 > 0); + next if ($cell !~ /^A(\d+)$/ || $1 < 1); my $row = $1; (undef,$value) = split('__&&&__',$value); $value = 'Default' if (! defined($value)); @@ -510,7 +513,7 @@ sub set_row_numbers { next if ($row == 0); my ($symb,undef) = split('__&&&__',$formula); $self->{'row_numbers'}->{$symb} = $row; - $self->{'maxrow'} = $1 if ($1 > $self->{'maxrow'}); + $self->{'maxrow'} = $row if ($row > $self->{'maxrow'}); } } @@ -540,7 +543,7 @@ These rows are saved in the courses dire ############################################# ############################################# sub load_cached_export_rows { - %Exportrows = undef; + undef(%Exportrows); my @tmp = &Apache::lonnet::dump('nohist_calculatedsheets', $ENV{'course.'.$ENV{'request.course.id'}.'.domain'}, $ENV{'course.'.$ENV{'request.course.id'}.'.num'},undef);