I think a reverse lookup table will do the job nicely. Thanks.
Sounds like just a simple list, again. As four or five answers in this thread have already said. What requirement prevents you from using the code that has been posted four or five times?
Do not construct a doubly linked list. People build those things because they don't have perlfunc:splice, so in Perl, it's almost always the wrong way to go.
-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.