Logo

Programming-Idioms

History of Idiom 117 > diff from v11 to v12

Edit summary for version 12 by :
New Perl implementation by user [Tom Legrady]

Version 11

2016-02-16, 16:08:02

Version 12

2016-02-16, 16:12:35

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;
Comments bubble
I like to be more explicit, using $N = scalar @array; but some people consider that overly verbose.