Not really perl-related but the best way of stopping spam is at the MTA level with RBLs (Runtime Black Lists.)
These are lists of the IP addresses of confirmed spammers and other machines which should not be sending mail such as open relays, home machines, etc. Some RBLs are rather trigger-happy and add blacklist legitimate users sometimes but the following, which I use with postfix, are considered pretty reputable:
For the first six months I used RBLs, I kept copies of rejected mail just to make sure I wasn't bouncing legitimate mail but I didn't have one false positive. However there is a small chance this could happen. But to me that risk is worth it for the dramatic reduction in spam. For spam that manages to evade the RBLs, the combination of spamassassin (with regular updates of the rulesets), clamav, and some procmail recipes provide a secondary line of defense.
I used to get 200-300 spam messages a day. Now thanks to these methods, I get 1 or 2.