Why doesn't unpack "P", 0 dump? I expected it to and this confused me.
The reason (on some level) is that pp_unpack() calls newSVpvn(), which calls sv_setpvn(), which has this code:
In other words, unpack("P", 0) just returns an undefined SV. Since C code often uses null pointers in the same way that Perl code uses undef, I think this is more useful than crashing. :-)if (!ptr) { (void)SvOK_off(sv); return; }
In reply to Re^2: How to kill perl?
by robin
in thread How to kill perl?
by robin
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |