P is for Practical | |
PerlMonks |
Is this a numeric context thing?by mephit (Scribe) |
on May 17, 2002 at 03:58 UTC ( [id://167195]=perlquestion: print w/replies, xml ) | Need Help?? |
mephit has asked for the wisdom of the Perl Monks concerning the following question:
Greetings, Monks.
I was skimming my older nodes and came across this reply, which says:
What I'm wondering, is if that's a numeric constant thing? If @_ is empty, does the array usage of [] force the undefined $_[0] into numeric context, which would make is a 0? Is that how that works? I did some tests, such as:
which is what I was expecting, thinking that an undef would be forced into a numeric 0 because of arithmetic operands. So, I'm pretty sure that's what's happening, but that's just an educated guess. Am I right? Thanks. -- Mephit (See my home node for my rant about Opera and PerlMonks, and my earliest nodes.
Back to
Seekers of Perl Wisdom
|
|