I am confused by how Perl treats arrays. With my @pins = (2, 3, 5, 7); the line my $n = @pins; gives 4, but my ($n) = @pins; gives 2. print "Pins: @pins\n"; prints the values, while print "Pins: " . @pins . "\n"; prints 4.
What rule decides whether I get the length or the elements, and what is the safe way to get the number of elements every time?




