in reply to Re^2: What array negative number counting means
in thread What array negative number counting means
(scalar @x) - 1 == 2
In other words
$x[-y] is a shortcut for $x[(scalar @x) - y]
=>
$x[-1] eq $x[2] eq "light"
$x[-2] eq $x[1] eq "bar"
$x[-3] eq $x[0] eq "foo"
Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: What array negative number counting means
by Anonymous Monk on Jul 28, 2020 at 00:22 UTC |