sub get_menu_items { my ($rules,@conditions) = @_; my %results; for my $cond ( @conditions ) { next unless exists $rules->{$cond}; for $item ( @{$rules->{$cond}->{allows}} ) { $results{$item}++; } } for my $cond ( @conditions ) { next unless exists $rules->{$cond}; for $item ( @{$rules->{$cond}->{disallows}} ) { delete $results{$item}; } } return keys %results; }
--
You said you wanted to be around when I made a mistake; well, this could be it, sweetheart.
In reply to Re^2: Checking lots of conditions...ORed and ANDed
by Solo
in thread Checking lots of conditions...ORed and ANDed
by TVSET
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |