3 ms·
my @arr = (1, 2, 3); for my $i ($[...$#arr) { ... } It is however, advised not to change $[.
by perl4ever 8y ago
my @arr = (1, 2, 3);
for my $i ($[...$#arr) {
...
}
It is however, advised not to change $[.
- perl4ever 8y agoAnd of course, there's Ada where you can use 'First and 'Last.