⭐ in reply to How do I find the index of the last element in an array?
You can also use negative array indexes:
The result is "four".my @demo = ("one", "two", "three", "four"); print $demo[-1];
|
---|
In Section
Seekers of Perl Wisdom