Linux Ask!

Linux Ask! is a Q & A web site specific for Linux related questions. Questions are collected, answered and audited by experienced Linux users.

Aug 162010

A simple array in Perl


Array is a list like data structure in Perl. It allows you to access to the elements inside the array sequentially.


use strict;
use warnings;

my @a = (1, 2, 3);

print $a[2]; # print '3', since Perl array is zero-indexed

 Leave a Reply



You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>