in reply to Deep recursion problem

Well -- Why do you want to do such a strange thing ? perl isn't haskell you know ;)

Anyway perl arrays know how big they are, just ask them

 my $size = @array;