Help for this page

Select Code to Download


  1. or download this
    # generate numeric comparison routines
    sub build_num_comp {
    ...
      elsif($cexp eq 'nr') { return sub { return ($_[0] !~ /$cval/); } }
      else { print "Invalid comparison, use ax -h for help.\n"; exit(1); }
    }
    
  2. or download this
    sub build_num_comp {
       my $truth = eval "@_";
    ...
    
    print build_num_comp(5,'==',5)->() ? 'yes' : 'no';
    print build_num_comp(5,'!=',5)->() ? 'yes' : 'no';