Using scalar function to get the array length
@array = (1, 2, 3); print "\@array has " . scalar(@array) . " elements.";