[Chicago-talk] Using "@" to reference element in array

Jay Strauss me at heyjay.com
Thu Oct 1 14:42:09 PDT 2009


Hi,

I just got a script at work where the writer used:

my @array = qw[adf af a adf asdfd];
print @array[2];

And it works!!

I thought that notation didn't go into effect until Perl6.

I've always done $array[2], and never tried the style above.  Is there any
reason not to adopt the style above in future Perl5 programming?

Thanks
Jay
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.pm.org/pipermail/chicago-talk/attachments/20091001/3717ca54/attachment.html>


More information about the Chicago-talk mailing list