RosettaCodeData/Task/Arrays/Perl/arrays-1.pl

9 lines
203 B
Perl

my @empty;
my @empty_too = ();
my @populated = ('This', 'That', 'And', 'The', 'Other');
print $populated[2]; # And
my $aref = ['This', 'That', 'And', 'The', 'Other'];
print $aref->[2]; # And