in reply to pattern matching question

You're problem is that .* is greedy (i.e., it matches everything it possibly can). See also Death to Dot Star!.

----
I wanted to explore how Perl's closures can be manipulated, and ended up creating an object system by accident.
-- Schemer

Note: All code is untested, unless otherwise stated