In order to get length of an array you can
+ either, use scalar() to force array length
+ or, take $#array_name + 1
my @letters = qw[ A B C D ];
print "Using Scalar: ".scalar( @letters )." elements.\n".
"Using Indice: ".( $#letters + 1 )." elements.\n";
Have fun!@