arrays don't have a concept of "(un)defined"Yeah, that's an odd design decision which I personally disagree with. I see no logical reason to distinguish between "empty" and "undefined" for scalars, but not for arrays.
In any case, I considered going into that in my previous comment, but obviously decided against it. I probably should have, given that the literal answer to "How to differentiate an empty array from an uninitialized one?" is "You don't, because Perl doesn't."
Interesting. I wasn't aware of that behavior in split. Thanks for pointing it out!$ perl -wMstrict -MData::Dump -e 'dd split /-|(x)/, "-", -1' ("", undef, "")
In reply to Re^3: How to differentiate an empty array from an unitialized one?
by dsheroh
in thread How to differentiate an empty array from an unitialized one?
by iatros
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |