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

Your version is canonical in perl6.

Perl 5 is stricter - it insists on Scalars being represented by the "$" sigil - in your case, printing ONE score item is a scalar, so perl (5) expects a "$".

     Syntactic sugar causes cancer of the semicolon.        --Alan Perlis

  • Comment on Re: Scalar value @scores_sorted[$i] better written as $scores_sorted[$i]

Replies are listed 'Best First'.
Re^2: Scalar value @scores_sorted[$i] better written as $scores_sorted[$i]
by JavaFan (Canon) on Jan 03, 2011 at 10:09 UTC
    Perl 5 is stricter - it insists on Scalars being represented by the "$" sigil - in your case, printing ONE score item is a scalar, so perl (5) expects a "$".
    Partially right. In this case, a one element list is printed.

    I find the warning highly annoying. It's a case where Perl knows what I mean, does what I mean, and still thinks it's Python, insisting in one true way of doing things. Despite it being the syntax of the future.