in reply to Scalar value @scores_sorted[$i] better written as $scores_sorted[$i]
The sigil to use is the type being returned.
$foo # Scalar $foo[$i] # Array element, a scalar $foo{$k} # Hash element, a scalar @foo # Array contents, a list of scalar values @foo[$i, $j] # Array slice, a list of scalar values @foo{$k1, $k2} # Hash slice, a list of scalar values %foo # Hash contents, a list of key-value pairs
$foo[EXPR] and @foo[EXPR] differ in the context in which EXPR is evaluated, and they differ in the number of scalars they can return.
|
|---|
| 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 13:22 UTC | |
by ikegami (Patriarch) on Jan 03, 2011 at 14:53 UTC | |
by JavaFan (Canon) on Jan 03, 2011 at 14:57 UTC |