Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"

Re^2: How to kill perl?

by robin (Chaplain)
on Nov 04, 2005 at 18:35 UTC ( #505833=note: print w/replies, xml ) Need Help??

in reply to Re: How to kill perl?
in thread How to kill perl?

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:

if (!ptr) { (void)SvOK_off(sv); return; }
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. :-)

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://505833]
[talexb]: That would have been interesting .. phone interview with BigCorp while the piano tuner does his magic. Awkwardness successfully averted!

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (7)
As of 2017-11-17 18:43 GMT
Find Nodes?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:

    Results (270 votes). Check out past polls.