in reply to Complex if/else or case logic
This will depend on your use-case, (replacing procmail, or just filtering mails intelligently..), but you might enjoy a peek at Mail::Audit and Email::Filter, both of which have the easy parts done.