in reply to Bijective data association structure?
You'll probably just want to build your hash as a circular linked list:
Update: with circular linked lists you usually keep track of head/tail:my $position_of = ( 'A' => { next_key => 'A#', prev_key => 'G#', # other stuff . . . }, 'A#' => { next_key => 'B', prev_key => 'A', # other stuff . . . }, ### in-between stuff 'G#' => { next_key => 'A', prev_key => 'G', # other stuff . . . }, );
my $head = 'A'; my $tail = 'G#';
--Jim
In Section
Seekers of Perl Wisdom