John Porter wrote:

> Nathan Wiger wrote:
> >
> >    undef                     null
> >    ------------------------  ------------------------
> >    $a = undef;               $a = null;
> >    $b = 1;                   $b = 1;
> >    $c = $a + b;              $c = $a + $b;
> >    $c is 1                   $c is null
>
> Uh, this is a difference in the implementations of the '+'
> operator, not the data value undef/null.
> Operators that treat undef the way SQL treats null are
> trivial to implement.

With the multitudinous operator approach, please show me how to make
each of the following conditional statements print true, without
cluttering the code with interleaved additional pragmas and scoping
blocks.  Use of pragmas before the code might be acceptable.

     no strict;
     $a = undef;
     $b = null;
     $c = $a + $b;
     $d = $a + 1;
     $e = $b + 1;

     print "true"  if defined $c;
     print "true"  if defined $b;
     print "true"  if isnull $e;
     print "true"  if defined $d;
     print "true"  if $d == 1;
     print "true"  if $e != 1;
     print "true"  if ! ($b == 0);
     print "true"  if $a == 0;

The multitudinous operator approach is not a solution.

--
Glenn
=====
Even if you're on the right track,
you'll get run over if you just sit there.
                       -- Will Rogers



_____NetZero Free Internet Access and Email______
   http://www.netzero.net/download/index.html

Reply via email to