in reply to Rules based Perl

Comparing single values against a list of values isn't too hard.

use List::Util qw[ min max ]; if( $X < min( $a, $b, $c ) and $Y > max( $a, $b, $c ) or $Z < min( $b, $c, $d ) ) { # do something }

The lists can equally be arrays of as many values as you need.

Unfortunately, the example is incomplete. I couldn't find a state diagram for 'possibly' :)


Examine what is said, not who speaks.
"Efficiency is intelligent laziness." -David Dunham
"Think for yourself!" - Abigail
Hooray!
Wanted!

Replies are listed 'Best First'.
Re: Re: Rules based Perl
by thor (Priest) on Nov 06, 2003 at 13:23 UTC
    Couldn't 'possibly' be interpreted as 'or'? For instance, if I have 'b and c but possibly a', couldn't I also write that as 'a or (b and c)'? That way, the evaluation of a does not necessarily determine the truth of the entire staement, but it has the possibility of making the entire statement evalutate to true.

    thor

      Possibly:)


      Examine what is said, not who speaks.
      "Efficiency is intelligent laziness." -David Dunham
      "Think for yourself!" - Abigail
      Hooray!
      Wanted!