Logo

Programming-Idioms

This language bar is your friend. Select your favorite languages!
  • Perl
my $x = $items[-1];

$items[] looks up a single element from list @items.
Negative indices count from the end of the list.
my $x = $items[$#items];

$#items represents the last index variable for items array
X := Items'Last

X must be declared earlier.

New implementation...