$condition = "(($a && $b) || ($c && $d))"; $a = 1; $b = 1; $c = 0; $d = 1; #Now, I have to check the condition. if condition true { print "Your condition is true; print some arbitrary variables here; }