Logo

Programming-Idioms

History of Idiom 165 > diff from v52 to v53

Edit summary for version 53 by andrezgz:
New Perl implementation by user [andrezgz]

Version 52

2019-09-27, 09:42:14

Version 53

2019-09-27, 22:57:54

Idiom #165 Last element of list

Assign to variable x the last element of list items.

Idiom #165 Last element of list

Assign to variable x the last element of list items.

Code
my $x = $items[$#items];
Comments bubble
$#items represents the last index variable for items array