in reply to Re: parser for evaluating arbitrarily complex boolean function in a string
in thread parser for evaluating arbitrarily complex boolean function in a string

hi blokhead,

i am new to perl and my requirement is also almost similar ! I was trying to understand the solution you posted.

can you explain me the following pieces of your code pl. ??

my @vars = do { my %seen; grep !$seen{$_}++, $bool_func =~ /([a-zA-Z]\w*)/g; };
and also the following statements
for my $assignment ( 0 .. (2**@vars)-1 ) { my %val; $val{$vars[$_]} = ( $assignment >> $_ ) & 1 for 0 .. $#vars; .........