My position is that what happens in the first case is the proper thing to do.
The first and third case are behaving correctly. The middle one should behave like the first, but open can't tell the difference between an unallocated array element and undef (since they both return the undef).
the addresses seem to differ - why is that?
I believe memory addresses are varied between program runs to minimize the damage from certain types of attacks. If you did both Dump in the same run, they would have the same address.
$ perl -MDevel::Peek -e'Dump($ARGV[0]); Dump(undef);' SV = NULL(0x0) at 0xf78148 REFCNT = 2147483639 FLAGS = (READONLY,PROTECT) SV = NULL(0x0) at 0xf78148 REFCNT = 2147483639 FLAGS = (READONLY,PROTECT) $ perl -MDevel::Peek -e'Dump($ARGV[0]); Dump(undef);' SV = NULL(0x0) at 0xbe6148 REFCNT = 2147483639 FLAGS = (READONLY,PROTECT) SV = NULL(0x0) at 0xbe6148 REFCNT = 2147483639 FLAGS = (READONLY,PROTECT)
In reply to Re^5: open undef
by ikegami
in thread open undef
by morgon
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |