in reply to Re^4: open undef
in thread open undef
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)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: open undef
by morgon (Priest) on Aug 02, 2018 at 20:37 UTC | |
by ikegami (Patriarch) on Aug 02, 2018 at 20:49 UTC | |
by morgon (Priest) on Aug 02, 2018 at 20:57 UTC | |
by ikegami (Patriarch) on Aug 05, 2018 at 05:16 UTC | |
|
Re^6: open undef
by BillKSmith (Monsignor) on Aug 07, 2018 at 14:20 UTC | |
by ikegami (Patriarch) on Aug 08, 2018 at 02:15 UTC | |
by BillKSmith (Monsignor) on Aug 08, 2018 at 11:01 UTC |