http://www.perlmonks.org?node_id=866323


in reply to Re: Code Shortening (golf)
in thread Code Shortening (golf) [RESOLVED]

Actually, my solution is similar to yours. The elongated solution is:
$n+=3-length($_)%4 for<>=~/(.*?)[A-Z]/g;print$n-3

Lately, I found out about the bit-wise operator '&' and substituted it.