Logo

Programming-Idioms

History of Idiom 117 > diff from v12 to v13

Edit summary for version 13 by :
[Perl] fixed name of array to spec

Version 12

2016-02-16, 16:12:35

Version 13

2016-02-16, 16:13:30

Idiom #117 Get list size

Set n to the number of elements of list x.

Idiom #117 Get list size

Set n to the number of elements of list x.

Code
my $N = @array;
Code
my $N = @;
Comments bubble
I like to be more explicit, using $N = scalar @array; but some people consider that overly verbose.
Comments bubble
I like to be more explicit, using $N = scalar @x; but some people consider that overly verbose.