These cascading if-elsif-elsif-else may be improved with a [dispatch table](http://www.perlmonks.org/?node_id=456530). It's a small concern, though.