On 19/11/17 15:40, Gil Magno wrote:
> $num_of_params = scalar @_;

Complementing... In order to get the number of params, you could do

    $num_of_params = @_;

without using "scalar @_", because this assignment is already in scalar
context.

But if you're in list context, you have to use "scalar", as in these

    say scalar @_;
    print scalar @_;

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to