Logo

Programming-Idioms

History of Idiom 117 > diff from v51 to v52

Edit summary for version 52 by piotao:
New Perl implementation by user [piotao]

Version 51

2020-07-05, 20:31:42

Version 52

2020-07-29, 21:56:31

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.

Variables
n,x
Variables
n,x
Extra Keywords
length
Extra Keywords
length
Code
$size = scalar @list;
Comments bubble
This is a recommended way, which ensures that any kind of list is in scalar mode, where only it's size is produced.