perl array
# Basic syntax: my $array_element = $your_array[array_index]; # Note, Perl's use of sigils ($, @, %) can be a little confusing. Even though # your_array is an array, when accessing a single element it's essentially # a scalar so you use $ both for the array and the new variable # Example usage: # Define array my @your_array = (2.3, 42, 'Word'); # Select 2nd element (zero-indexed) my $array_element = $your_array[2]; print "$array_element\n"; --> Word
Source: www.tutorialspoint.com
perl array
$ages[0] = 25 $ages[1] = 30 $ages[2] = 40 $names[0] = John Paul $names[1] = Lisa $names[2] = Kumar
Source: www.tutorialspoint.com