Subject: | Bug in testing for keys |
Reported by Bart Vetters <robartes@nirya.be>, Oct. 10, 2002 in E-mail:
some people have found a bug in the Tie::RegexpHash.pm module. The
discussion is at http://www.perlmonks.org/index.pl?node_id=204227.
The bug is at lines 58 and 59 in version 0.10. Because you access
$self->{KEYS}->[ $i ] before you test that $i < $self->count, you run
over the end of the array referenced in $self->{KEYS}. The simplest
solution, as jsprat indicates in the discussion, is to switch the order
in which the two tests are taken.
Thanks for a great module!