in reply to Re: Defined test creates non-empty hash value
in thread Defined test creates non-empty hash value
"This is quite unfortunate. This means we have changed the state of the %people has just by observing it. ... I think these undesirable cases are now generally considered to be a bug in Perl. Unfortunately it is very unlikely that this bug will be fixed in Perl 5 as there is a lot of code out in the wild (both on CPAN and in companies) that rely on this behavior. Correcting the behavior would break a lot of code."
In the event, I am now wiser. Unfortunately, when creating some sparse hashs of arrays I do rely upon autovivification, with tests to identify their non-existence when necessary. But will now know how to adapt ...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Defined test creates non-empty hash value
by cavac (Prior) on Jun 13, 2024 at 10:00 UTC | |
|
Re^3: Defined test creates non-empty hash value
by LanX (Saint) on Jun 14, 2024 at 12:53 UTC | |
by LanX (Saint) on Jun 15, 2024 at 13:48 UTC |