- or download this
use strict;
use warnings;
...
print "$key is the first item\n";
}
}
- or download this
2 follows 1
1 is the first item
...
3 precedes 5
10 is the last item
9 precedes 10
- or download this
my %lookup = map {$keys[$_] => {prev => $keys[$_ - 1], next => $keys[$
+_ + 1]}} 0 .. $#keys;