perlfaq nodetype
faq_monk
<P>
The former is a scalar value, the latter an array slice, which makes it a
list with one (scalar) value. You should use $ when you want a scalar value
(most of the time) and @ when you want a list with one scalar value in it
(very, very rarely; nearly never, in fact).
<P>
Sometimes it doesn't make a difference, but sometimes it does. For example,
compare:
<P>
<PRE> $good[0] = `some program that outputs several lines`;
</PRE>
<P>
with
<P>
<PRE> @bad[0] = `same program that outputs several lines`;
</PRE>
<P>
The <STRONG>-w</STRONG> flag will warn you about these matters.
<P>