Glenn Linderman <[EMAIL PROTECTED]> writes:

> 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;

Why on earth would you want to do this in real code?

I don't believe you actually need both semantics active at the same time;
it might take really minor rewording of the code (initialize to 0 instead
of undef for counters, etc.), but I'm very unconvinced that you need both
concepts active at the same time.

-- 
Russ Allbery ([EMAIL PROTECTED])             <http://www.eyrie.org/~eagle/>

Reply via email to