For Each Top There Must Be a Bottom ...

I then revised the code passage for the bottom line in a similar manner:

  sub _calculate_all_groups_week {
    my $v = shift;
    my %all_group_wk = %{$v};
    my ($sch, $occ, $percent);
    $sch     = defined ($all_group_wk{'sched'}) ? $all_group_wk{'sched'} : 0;
    $occ     = defined ($all_group_wk{'occur'}) ? $all_group_wk{'occur'} : 0;
    $percent = $sch                             ? $occ / $sch * 100      : 0;
    return ($sch, $occ, $percent);
  }

The bottom part of the original subroutine now looked like this:

  foreach my $period (@overall) {
    my ($sch, $occ, $percent) = _calculate_all_groups_week(\%{$period});

Previous Back to start of show Next
Slide: 8 topbottom © 2003 James E. Keenan