<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:arial, helvetica, sans-serif;font-size:10pt"><DIV>&nbsp;</DIV>
<DIV>@array[2] is just an array with one element. ('a')&nbsp;; and print prints out the element.<BR></DIV>
<DIV style="FONT-FAMILY: arial, helvetica, sans-serif; FONT-SIZE: 10pt"><BR>
<DIV style="FONT-FAMILY: times new roman, new york, times, serif; FONT-SIZE: 12pt"><FONT size=2 face=Tahoma>
<HR SIZE=1>
<B><SPAN style="FONT-WEIGHT: bold">From:</SPAN></B> Jay Strauss &lt;me@heyjay.com&gt;<BR><B><SPAN style="FONT-WEIGHT: bold">To:</SPAN></B> Chicago.pm chatter &lt;chicago-talk@pm.org&gt;<BR><B><SPAN style="FONT-WEIGHT: bold">Sent:</SPAN></B> Thu, October 1, 2009 4:42:09 PM<BR><B><SPAN style="FONT-WEIGHT: bold">Subject:</SPAN></B> [Chicago-talk] Using "@" to reference element in array<BR></FONT><BR>Hi,<BR><BR>I just got a script at work where the writer used:<BR><BR>my @array = qw[adf af a adf asdfd];<BR>print @array[2];<BR><BR>And it works!!<BR><BR>I thought that notation didn't go into effect until Perl6.<BR><BR>I've always done $array[2], and never tried the style above.&nbsp; Is there any reason not to adopt the style above in future Perl5 programming?<BR><BR>Thanks<BR>Jay<BR></DIV></DIV></div></body></html>