# assume two arrays with a number of elements # @rray1 & @rray2 my $elements_1 = scalar @rray1; # or my $elements_2 = $#rray2 + 1;