in reply to Script Critique

Something that you should consider later on..

There are various philosophies of APIs, interfaces between not just a program and users, but the interface between the coder and what you are using.

One possible philosophy is as follows.

A script is not meant to be solid. A script is throw away. A script may be quite short, although it may set off a chain of complex events.

One of the wonderful things of perl is that you can store complex code in modules. And scripts can make calls in various ways to library code (modules, etc).

Per this kinf of ideology- The way to make your 'code' solid, would be to set up a test suite for your functions and procedures.
After that, a script would merely take in input perhaps, check it, and perhaps spit output or feedback.

Thus, seeking a 'solid' script could be considered to be- finding the perfect cup from which to drink beer. When perhaps the beer's source is more important.

Again, this is just one way to look at it.
I hope this sounds interesting and doesn't annoy too much.