Re:Microfeatures I'd like to see in more languages
by tmtvl on Friday January 06, 2023 @07:04AM
(#34273785)
Yeah, but $#list is better used for writing loops:
For getting the last element from a list you can just use -1 (and of course further negative numbers work like you would expect, -2 is second to last and so on):
[ Parent
| on HN ]
Re:Microfeatures I'd like to see in more languages
by melagonster on Friday January 06, 2023 @08:36AM
(#34274396)
yes, I forgot perl have negative index!