It probably would help if you told us the error message that you are seeing.
It might also be useful to tell us what you are trying to do, as we might be able to suggest an alternative.
The only reference I see in the documents for Match.pm is
Note that unused answers are dumped into the
list of extra 'answers' so the indexing may be difficult to grasp at first.
(This can be stopped by doing the following: $ml->dumpExtra = ""; )
but this is probably in error, as dumpExtra is a function, not a
variable, so can't be assigned to in this way. If you are trying to
prevent unused answers from being added to the extra answers (not clear
from your question), then I can suggest three ways.
First, you could make your own subclass of the Match object and override the dumpExtra method: package MyMatch; out @ISA = qw(Match);
sub dumpExtra {};
package main;
$ml = new MyMatch(...);
This would make dumpExtra do nothing.
Another alternative is that, since dumpExtra is only called from the choose method, you could just do what it does, but leave out the call to dump . For example: $ml->getRandoms(scalar(@{$mlf->{questions}}), choose-arguments); $ml->selectQA(); $ml->condense();
where choose-arguments is the list of argument you normally would have passed to $ml->choose()
Finally, you could call $ml->choose() as normal and try to undo the effect of dumpExtra by popping off the extra questions that have been added to the list. $ml->choose(...); split(@{$ml->{extras}},scalar(@{ml->{slice}})-scalar(@{$ml->{answers}}));
(I haven't tested any of this code, so you may need to adjust it.)
Hope that helps.
Davide
<| Post or View Comments |>
|