in reply to Count elements in multidimensional arrays
In the second one you are assigning to $ar1 which isn't @ar1. If you used strict and warnings you would have been warned about this.
In Section
Seekers of Perl Wisdom
in reply to Count elements in multidimensional arrays