in reply to Re: Scalar value @scores_sorted[$i] better written as $scores_sorted[$i]
in thread Scalar value @scores_sorted[$i] better written as $scores_sorted[$i]
The sigil to use is the type being returnedActually, it isn't. Here are some counter examples:
The sigil can influence what is returned, but foremost, it's the context that will determine what is returned. In particular, in scalar context, a scalar will always be returned.@foo # Number of elements of the array. @foo # A reference to the array. @foo[$i, $j] # Last element of slice. @foo{$k1, $k2} # Last element of slice. %foo # A reference to the hash. %foo # True/false. %foo # String with ratio of filled buckets and buckets.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Scalar value @scores_sorted[$i] better written as $scores_sorted[$i]
by ikegami (Patriarch) on Jan 03, 2011 at 14:53 UTC | |
by JavaFan (Canon) on Jan 03, 2011 at 14:57 UTC |