note
AnomalousMonk
<p>
Further to [hdb]'s [id://1036726|reply]:
</P>
<blockquote><i>
... it seems that a shorthand like </I>&#91;evaluating an array in scalar context&#93;<i> cant travel well around different loops etc.?
</I></BLOCKQUOTE>
<p>
It travels perfectly well. [hdb] and others have already pointed out that <c> @saba </C> and <c> $saba </C> are quite different things and are in no way <i>inherently</I> related.
</P>
<p>
What may be confusing you is the fact that an <i>element</I> of the <c> @array </C> array is accessed by the syntax <c> $array[</C><b><i>n</I></B><c>] </C> (note the <c> $ </C> sigil). The logic of this, determined by Larry at the Dawn of Time (Perl version 1.0), is that the elements of arrays (and also of hashes &ndash; associative arrays) are always and only <i>scalars</I>. But you always have to distinguish between an <i>array</I>, which contains (like a hash) a certain number of elements and thus has, among other properties, a size, and an <i>element</I> of an array.
</P>
1036718
1036725