in reply to Vote-based porn detection

your description made me remember of danbooru style boards

their rating system is pretty much what you asked.
some of them, including danbooru itself, are open source, so you could look at the code and make your own perl version.