in reply to reordering a stack with little effort
In perl, I would create an array of questions, each array element holding a reference to a hash:
Note here that QUESTION_NUM is just the index in the array plus 1.my @questions # a question from the Tasmanian Devil push @questions, {id => 1, text => "Why for you want to bury me in the + cold, cold ground?, show => 1}; # etc.
Then inserting a question after question 10 is a simple matter of of a splice:
For references to other questions, just add a reference => $quest_ref element to the hash.# Maxwell Smart? my $new_q = {id => 9, text => "Shall we use the Cone of Silence?, show + => 1}; splice @questions, 9, 0, $new_q;
-Mark
In Section
Seekers of Perl Wisdom