Syntactic Confectionery Delight | |
PerlMonks |
Re^3: Using 'keys' on a list (update x2)by LanX (Saint) |
on Jun 30, 2021 at 12:32 UTC ( [id://11134487]=note: print w/replies, xml ) | Need Help?? |
> no, list in scalar context returns the last value That's wrong. A comma separated list returns the last value in scalar context, otherwise it always depends on the operator.
updatesurrounding a LIST with (...)[-1] is a reliable way to get the last element
updatesee also
Cheers Rolf
In Section
Seekers of Perl Wisdom
|
|