BooleanEval - Boolean expression parser. An example of its use: use Math::BooleanEval; my $bool = Math::BooleanEval->new('yes|no'); # evaluate each defined item in the expression to 1 or 0 foreach my $item (@{$bool->{'arr'}}){ next unless defined $item; $item = ($item =~ m/^no|off|false|null$/i) ? 1 : 0; } # evaluate the expression print $bool->eval(); To install, do the usual make routine: perl Makefile.PL make make test make install ... or you could just copy BooleanEval.pm into the Math/ subdirectory or your Perl include path.