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.

A simple array in Perl

Answer:

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

Example:

use strict;
use warnings;

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

print $a[2]; # print '3', since Perl array is zero-indexed
  1. Array reference in Perl
  2. A simple hash in Perl
  3. How to find a Perl Module’s Path
  4. How to find out whether reference is pointing to a scalar, array or hash in Perl?
  5. Run Perl with useful warnings

One Response to “A simple array in Perl”

  1. [...] Array reference is something like a pointer to a array data structure in Perl [...]

Leave a Reply

(required)

(required)

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>