This post fits more into "Useless Use of Perl" or "Insane Application of Regex" but there are no such categories. (And I'm sure someone could obfuscate the code. But I'd rather leave it to the experts.)

Scenario:

Say you're a hard-working grad student working late at night in a grocery store. You're drowsy, can't compute in your head.

In the town you work, the dollar bills could be of any arbitrary denomination ($1.3, $423, $94.32, etc.) but the coins are always quarter (25 cents), dime (10 cents), nickel (5 cents) and penny (1 cent).

Nearby your grocery store is a nightclub. The patrons often come ask you for change. They want you to break their dollar bills into as many quarters as possible (for parking meters).

As a tired Perl programmer and grad student writing a thesis on "Regex as Greek Gods of A.I.", you want to automatically figure out the combination of the number of coins you can break a bill into while maximizing the number of quarters.

Solution:
sub small_change { ('m'x(100*$_[0]))=~/^(m*)\1{24}(m*)\2{9}(m*)\3{4}(m*)$/; print "\$$_[0] can be broken into:\n".length($1)." quarters, ".len +gth($2)." dimes, ".length($3)." nickels and ".length($4)." pennies.\n +"; } small_change(3.43); # print: # $3.43 can be broken into: # 13 quarters, 1 dimes, 1 nickels and 3 pennies.