On Mon, Mar 20, 2023 at 09:41:19PM +0100, demerphq wrote: > On Mon, 20 Mar 2023 at 21:33, Zefram via perl5-porters < > perl5-porters@perl.org> wrote: > > > $ perl -Mexperimental=refaliasing -lwe '%a = (aa=>11,bb=>22,cc=>33); > > Internals::SvREADONLY(%a, 1); Internals::SvREADONLY($a{bb}, 1); print > > \$a{bb}; \$a{bb} = \555; print \$a{bb}' > > SCALAR(0x55f3eee968a0) > > SCALAR(0x55f3eefd7aa8) > > > > Yep, that is a bug. Note that this is a general issue with aliasing, e.g. via 'local', not just with the \ refaliasing mechanism: %a = (aa=>11,bb=>22,cc=>33); Internals::SvREADONLY(%a, 1); Internals::SvREADONLY($a{bb}, 1); local $a{bb} = 555 if @ARGV; delete $a{bb}; $ pp Attempt to delete readonly key 'bb' from a restricted hash at /home/davem/tmp/p line 9. $ pp 1 $ -- It's not that I'm afraid to die, I just don't want to be there when it happens. -- Woody AllenThread Previous | Thread Next