$#array_name can be used to find the length of an array, @array_name, but I'm not entirely sure how you're going to be getting at the array so I can't really be more helpful than that
Update: As Taulmarill rightly points out this isn't strictly the length of the array, but the index of the last element, which is normally one less than the length of the array since they are zero-indexed (ie the first element of the array has index 0, not 1 as you might expect), but you might find this useful as well :)