when we are assigning any array in scalar context, we are getting length of that array. i.e. say we have an array @arr = (1,2,3,4,5,6);
lets say we have a scalar $x in which i will assign this array, $x=@arr; In this case $x will contain 6 i.e the length of @arr. But I want to know the reason that when we are assigning @arr to $x , why we are getting the scalar value as the length of array ? what is the reason behind it.
I searched at my level but could not find any proper reason. Can you help me please!!!!
NOTE: i want to know the internal functionality for this case. Please explain in that direction only..