in reply to find real length of an array

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