Solving diophantine equations works in Perl 5.8 as well:
# Solve 12x + 15y + 16z = 281
$_ = 'o' x 281;
m/^(o*)\1{11}(o*)\2{14}(o*)\3{15}$/;
print length($1),"\t", length($2),"\t", length($3),"\n";
PS: I did not invent this, but found it somewhere and cannot remember where.
CountZero
A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James