use strict; use warnings; ### Array of lines my @arr1 = (q|this is the first line|, q|this is the second line|); print "$arr1[0]\n"; # this is the first line ### Array of all words my @arr2 = (qw|this is the first line|, qw|this is the second line|); print "$arr2[0]\n"; # this print "@arr2\n"; # this is the first line this is the second line ### Nested array of words in each line my @arr3 = ([qw|this is the first line|], [qw|this is the second line|]); print "$arr3[0][0]\n"; # this print "@{$arr3[0]}\n"; # this is the first line ### Reference to array of lines my $arr1 = [q|this is the first line|, q|this is the second line|]; print "$arr1->[0]\n"; # this is the first line ### Reference to array of all words my $arr2 = [qw|this is the first line|, qw|this is the second line|]; print "$arr2->[0]\n"; # this print "@$arr2\n"; # this is the first line this is the second line ### Reference to nested array of words in each line my $arr3 = [[qw|this is the first line|], [qw|this is the second line|]]; print "$arr3->[0][0]\n"; # this print "@{$arr3->[0]}\n"; # this is the first line