Perl has *one* out-of-band value.  It doesn't need more.  That
doesn't mean that perhaps some rare sorts of programming might not
benefit from fancy weirdnesses.  That's what modules are for.
You don't need to complicate the general language to get what
you want.  Don't make others pay for your problems.

>1) all otherwise uninitialized variables are set to undef

Wrong.  You cannot say that an aggregate is undef.  Scalar
variables--not all variables, just scalar variables alone--hold the
uninitialized value, henceforth known as the antiļinitialized value,
if they were last initialized to the antiļinitialized value, or if
they haven't been initialized at all--in which case, I suppose, you
*might* choose to call it _a_n_t_eļinitialized instead of antiļinitialized,
but then you'll get people wanting to split those up again.

>2) under "use strict", use of undef in expressions is diagnosed with a warning

Wrong.  You are thinking, perhaps, of `use warnings', not `use strict'.
In particular, 

    use warnings qw'uninitialized';

>3) undef is coerced to 0 in numeric expressions, false in boolean expressions,
>and the empty string in string expressions.

I'm not happy with your use of "coerce".  There's no mutation.  It simply
*is* those things.  It's not quite kosher to claim that undef gets "coerced"
to false in Boolean expresions.  The antiļinitialized value *is* a false
value.  The only false number is 0, and therefore the antiļinitialized 
numeric value is 0.  Yes, we have two false strings--lamentably--but since
we need a canonical one (eg the result of 1 == 2), we choose "".

You also forgot this:

4) The antiļinitialized value is autovivified to a true value when
    used that value is (legally) used lvaluably.  

Notice also this:

    % perl -le 'use warnings; $a = 1 == 2; print $a->[1] ? "good" : "bad"'
    bad

    % perl -le 'use strict;   $a = 1 == 2; print $a->[1] ? "good" : "bad"'
    Can't use string ("") as an ARRAY ref while "strict refs" in use at -e line 1.
    Exit 255

--tom

Reply via email to