in reply to Re^2: Using 'keys' on a list
in thread Using 'keys' on a list
That's wrong.
A comma separated list returns the last value in scalar context, otherwise it always depends on the operator.
surrounding a LIST with (...)[-1] is a reliable way to get the last element
DB<7> x (1..5)[-1] 0 5 DB<8>
see also
Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^4: Using 'keys' on a list (update x2)
by Anonymous Monk on Jun 30, 2021 at 14:38 UTC | |
by The Perlman (Scribe) on Jun 30, 2021 at 15:29 UTC | |
by Anonymous Monk on Jun 30, 2021 at 15:35 UTC | |
by The Perlman (Scribe) on Jun 30, 2021 at 16:14 UTC | |
by Anonymous Monk on Jun 30, 2021 at 17:17 UTC | |
|