in reply to find real length of an array
ormy @array_2 = (1,2,3,4,5,6,7,8,9,undef,undef,undef,undef,undef,undef);
The reason that trailing commas are not a syntax error is so that you can write code like this:my @array_2 = (1,2,3,4,5,6,7,8,9); $array_2[14] = undef;
If the comma added another "undef" to the list then you would get a warning:my %hash = ( a => 1, b => 2, );
Odd number of elements in hash assignment. Use of uninitialized value in list assignment.
|
|---|