Subject: | HTML::Entities does not handle shared keys properly |
Later perl's do tricks to share keys, and HTML::Entities trips up on them.
The following code is generating an incorrect error message, the key is actually modifyable.
$ perl5.14.2 -MDevel::Peek -MHTML::Entities -le'print $]; my %hash=("A".."D"); @x= sort keys %hash; decode_entities($x[0]);'
5.014002
Can't inline decode readonly string at -e line 1.
Devel::Peek output looks like this:
$ perl5.14.2 -MDevel::Peek -le'print $]; my %hash=("A".."D"); @x= keys %hash; Dump($x[0]);'
5.014002
SV = PV(0xbd91e0) at 0xbed7f0
REFCNT = 1
FLAGS = (POK,FAKE,READONLY,pPOK)
PV = 0xbfe290 "A"
CUR = 1
LEN = 0
THE combo of FAKE and READONLY means the string is shared, but can be modified.
Yves