in reply to exists(&subname) causes strange autovivification problem
It's a bug in autovivification.
$ t() { perl -Mv5.40 -e' no if $ARGV[0], "autovivification"; my @a; push @a, [ exists(&nonesuch) ]; say $a[0][0] ? "exists" : "doesn\x27t exist"; ' "$@" } $ t 0 doesn't exist $ t 1 Modification of a read-only value attempted at -e line 4.
Workaround posted in a different post.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: exists(&subname) causes strange autovivification problem
by choroba (Cardinal) on Nov 06, 2024 at 18:38 UTC | |
|
Re^2: exists(&subname) causes strange autovivification problem
by LanX (Saint) on Nov 06, 2024 at 20:43 UTC | |
|
Re^2: exists(&subname) causes strange autovivification problem
by Danny (Chaplain) on Nov 08, 2024 at 20:51 UTC | |
by afoken (Chancellor) on Nov 08, 2024 at 21:33 UTC | |
by Danny (Chaplain) on Nov 08, 2024 at 23:41 UTC |