in reply to Scalar value @scores_sorted[$i] better written as $scores_sorted[$i]

Because you are printing a single value from the array @scores_sorted, that value is by definition a scalar. For any scalar value (even when part of a bigger structure) Perl expects to see a leading dollar sign. So the first element of array @foo is $foo[0], not @foo[0]. -Tom Williams
  • Comment on Re: Scalar value @scores_sorted[$i] better written as $scores_sorted[$i]