I am thinking how you can refer to an element in Perl array by the sign $
.
Minimum code
my @x = @{ $_[0] };
for(my $i=0; $i<$#x; $i++){
print $x[$i];
}
You initialize the array as @x
that is an array.
You print out each item from the array by $x[$i]
in a for loop.
I think it is a bit confusing when you initialize the array by @x
and get its size by $#x
.
Why can you refer to the Perl array by $x
?