[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]
Re: uninitialized vs. undefined
>An uninitialized scalar gets an undefined value, which is different
>from any other value the scalar can take (although, when used,
>undefined works out as being 0 or "").
>Likewise, an uninitialized array should have an undefined value,
>which is different from an empty array (although an uninitialized
>value behaves as ()). 'defined(@a)' would have been an nice way to
>test this.
That's one way to look at it.
Another way of looking at it (mjd: shh about &fn) is that defined()
is asking whether a scalar value happen to hold the value undef().
I find this a much better way to think about it, because now one
never tries to do silly things like asking whether an aggregate
holds the value undef().
--tom
- Follow-Ups from:
-
JVromans@squirrel.nl (Johan Vromans)
- References to:
-
JVromans@squirrel.nl (Johan Vromans)
[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]