There's more than one way to do things | |
PerlMonks |
Why doesn't this die with "Can't use an undefined value as an ARRAY reference"?"by kikuchiyo (Hermit) |
on Oct 18, 2017 at 17:49 UTC ( [id://1201610]=perlquestion: print w/replies, xml ) | Need Help?? |
kikuchiyo has asked for the wisdom of the Perl Monks concerning the following question: Consider the following script:
With Perl 5.24.3 it runs to the end and all tests pass, even though I would expect that it dies with an "Can't use an undefined value as an ARRAY reference" error when it tries to dereference $hash->{'100'} which indeed does not exist. Compare with
which dies with the expected error. Under Perl 5.16 the first program also dies with the expected error. (This is how we initially noticed the problem: a program that was developed on 5.22+ needed to be ported to Centos 7 which has 5.16, and the tests began to fail there.) What is going on here? (Errata: Now I've ran with more Perl versions (perversions), and it doesn't die under perl 5.22 and above, but dies as expected under perl 5.20 and below)
Back to
Seekers of Perl Wisdom
|
|