Help for this page

Select Code to Download


  1. or download this
    # Do this once for efficiency.
    use vars qw(%NUM_OPS %STR_OPS);
    ...
       $STR_OPS{$_} = eval "sub { \$_[0] $_ \$_[1] }"
          foreach (qw(lt le ne ge gt eq));
    }
    
  2. or download this
                $v = ${$pairs{$ca}}[0];
                if ($types{$ca}) {
    ...
                die("Undefined operation $co.\n") unless $op;
                $r &= $op->($v, $cv);