in reply to How to write a nice rule base?

Instead of:
$query->{action} eq "post" ? ($allowed{msgid} = '^(\d+|new)$') && ($al +lowed{data} = '^(([^|+]*[^|]+.*\|){4}[^|+]*[^|]+.*)$'):1;
try this:
$query->{action} eq "post" ? %allowed = (msgid => '(^\d+|new)$' , data + => '^(([^|+]*[^|]+.*\|){4}[^|+]*[^|]+.*)$)', action => 'post|edit|d +elete|long|short' ):1;
and so on. That works for me, though there may be a better solution. Your message was cut off before you told us why you iterate over %allowed--if you don't need the value of action in the iteration, this can be made simpler. Also, consider doing something about your use of sort as a key--the -w flag doesn't like that, either.