On Wed, Sep 20, 2000 at 08:30:44AM -0700, Nathan Wiger wrote:
> Using the proposed tristate pragma does not strike me as any better -
> in fact, worse - than adding null() because you are now changing the
> meaning of fundamental Perl operations. You're *still* introducing "yet
> another state of null", but to do so you're conflating undef and null,
> which are themselves different concepts. For example, assuming this
> code:
>
> $name = undef;
> print "Hello world!" if ($name eq undef);
>
> The same operation would print "Hello world!" in one circumstance, but
> nothing under the tristate pragma.
Right. as opposed to
print "Hello world!" if ($name eq null);
which would probably do the same.
But the point is that you only use the pragma IF THAT IS WHAT YOU WANT
adding null which is a bit different to undef, then later adding another
with is a litle different again in some way and then ....
This is not the way to go.
If you want an operator to act differently on some piece of data then a pragma
is the way to do it.
> This is just as dangerous as having a
> pragma like so:
>
> use 'zeroistrue';
> $num = 0;
> print "Got data" if ( ! $num );
Whats dangerous about that. It is doing exactly what I asked it to.
Graham.