in reply to Re^3: Help with arrays
in thread Help with arrays

I think what you want is  $size = $#nums;

Replies are listed 'Best First'.
Re^5: Help with arrays
by MidLifeXis (Monsignor) on Sep 24, 2012 at 13:05 UTC

    I think what you want is $size = $#nums;
    Probably not. $#nums is the index of the last item in the array @nums. In the usual case, that is one less than scalar(@nums), which gives you the size of the @nums array, not the index of the last element.

    --MidLifeXis