The index expression of $array[ EXPR ] is evaluated in scalar context, and the an array in scalar context evaluates to the number of elements in the array.
my @folder = qw( a b c d e f ); my @name = qw( x y z ); my $var = $folder[@name]; # $var = 'd', since @name == 3.
In reply to Re: new to perl, syntax question
by ikegami
in thread new to perl, syntax question
by tics
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |