in reply to I/O problems...what am I missing?

$control = @score; should be $control = $#score + 1; to get the size of the array (I believe that's what you're trying to do...

As said before, $names[$sub-1] = $tem; should be $names[$sub-1] = $temp2;

You also have an error in this for loop... (You need to use your $ctr, and reset it to 0 before the loop.)
$ctr = 0; foreach(@score){ $total += $score[$ctr]; $ctr++; }


The average score should be ($total / $control) or ($total / $ctr), lowest test score should be $score[0], and the highest should be $score[$control - 1] or $score[$ctr - 1]
print(map(lc(chr),split(6,qw/99672682673683684689632658645641610607/)));

Replies are listed 'Best First'.
Re: Re: I/O problems...what am I missing?
by slife (Scribe) on Sep 16, 2002 at 12:57 UTC

    "$control = @score; should be $control = $#score + 1; to get the size of the array"

    These statements are equivalent (since evaluating an array in a scalar context gives its length). Camel 3rd ed. p76 refers.

    Some have argued that the former is preferable (e.g. see MJD's comments).

      You guys are my heroes! I love you! Thanks