- Prison Code Breaker Diary -

=> aka: Nhật Kí Code Tù

Categories

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!@

0 comments

Post a Comment