My general golfing advice is to try to use $\ as the accumulator if you possibly can because you can then print it with a bald print.
For example, this one is six strokes shorter and gives the same result as yours for the three test cases given at the spoj web site:
Don't know if it's generally valid though.$\+=~y///c&3for<>=~/([a-z]+)/g;print
In reply to Re: Code Shortening (golf)
by eyepopslikeamosquito
in thread Code Shortening (golf) [RESOLVED]
by Young Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |