in reply to perl equivalent to php array count function

If you look at an array in a scalar context, it will return the number of items:

my @array = (1, 4, 9, 16); print scalar(@array); # prints 4

Hope that helps.