Fun, but none too impressive:
#!perl -l
(1x pop)=~/^(1+)\1+$(?{$x+=$+[1]})./;print$xOf course, Abigail is entirely to blame for this solution. I was a bit surprised to discover that $_ is set to the regex string within the re-eval, so I couldn't use it for the accumulator. Can't break 41. Grrrr. -Gary
