in reply to Efficient Linked Lists
my %index_of; @index_of{ @filenames } = (0..$#filenames); # given a filename, find its predecessor or successor: my $predecessor = $filenames[ $index_of{ $filename } - 1 ]; my $successor = $filenames[ $index_of{ $filename } + 1 ];
jdporter
The 6th Rule of Perl Club is -- There is no Rule #6.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Efficient Linked Lists
by Ionizor (Pilgrim) on Jan 31, 2003 at 20:49 UTC | |
by merlyn (Sage) on Jan 31, 2003 at 23:46 UTC | |
by Ionizor (Pilgrim) on Feb 01, 2003 at 04:49 UTC |