This is inspired by Ruby, but could apply to Perl as well.

Situation: class with dynamic, on the fly class method definitions of the form

What this does is defines some class methods role1_email_addresses, role2_email_addresses, etc on the fly.

Works perfectly, until the first element returned in users is actually an empty email.

This is an example of writing clever code for succinctness (which is rampant in ruby circles). The problem is this code has bugs, and in order to fix it you have to rewrite it or add extra checks and workarounds. Which means the code is no longer succinct nor clever.

In my recent experience, that’s all that overly-clever code gets you. You just end up making extra work for yourself (or the maintainer) down the line.