Array vs. List
- Array is a List of scalar containers.
> my $fruit = 'apple'; > my @array = (0, 1, $fruit); # an Array > @array[2] = 'cherry'; > say $fruit; apple > my $arrayref = [ 0, 1, $fruit ]; # an Array(ref) > $arrayref[2] = 'cherry'; > say $fruitcontinued...