"This doesn't sound like that difficult a task, but some interesting subtleties arose as I was starting to solve it in my head. So, I'm writing this column effectively in real time, as I would consider each piece of the problem, to illustrate effective practices at developing Perl routines."