Help for this page

Select Code to Download


  1. or download this
    #from Anonymous Monk code
    > my %allowed = qw{ ( ( ) ) ! !! & &&  };
    > my $finalExpr = map { $allowed{$_} || die "not allowed '$_'" } split
    + '', $expr;
    
  2. or download this
     print "EXPR = ",$newExpr,"\n";
    
    ...
     $newExpr =~ /^([\d\s()&|!]+)$/;
     printf "%b\n", eval $1;
    }