|Think about Loose Coupling|
Re: Re: Re: m//g behaves strange...by pg (Canon)
|on Nov 10, 2003 at 03:59 UTC||Need Help??|
You are very close to 100% right. However I do observe something else, and I don't let things escape easily.
If I do this:
The outputs are 1 and "empty string", which indicate that you are right.
However, try this:
Remeber the return values for zero and empty string, and then try this:
It gives you:
Which indicates the "~" operator does receive 0, not "empty string". Rememebr that in the case that we explicitly pass "~" an empty string, it is not converted to 0
However, if we do this:
It seems that although $ret receives "empty string", "~" operator receives 0, again rememebr that we didn't see this kind of auto-convertion in the explicitly-passing-empty-string case.