They take a lot of options, I have to test that
certain arguments come in certain groupings.
I'd say about 90% of my code is sanity checking
the arguments I get. It also seems that I
may plug in a bit of logic during that phase
to setup general usage variables, such as
unpack patterns so no matter what arguments
the programs was given, I boil the intermediate
data structures to something common across the
various possible uses.
Oh, and my helpful error message on usage. I
catch almost all design holes as I am creating
the initial error message.
After that point, the actual implemention of the
business algrithm seems almost trivial.
Do others feel this way?
For example, I'm writing a Split / Interleave
utility to interleave print records together for
multi-up forms.
Here is the help message:
\n./ns_split.pl: NS Split / Interleave program\n\nThe following options can be used.\n\n Input and output files. Do not use\n named pipes or STDIN / STDOUT. I might\n want to optimize memory and seek a bit.\n\n --in_name=s\n --out_name=s\n\n --log_name=s - default: ns_split.log\n\n --split_type=s\n\n Must be one of the following:\n\n A AMS Segment\n A-EP AMS Segment / Entry Point\n A-EP-P AMS Segment / Entry Point / Pallet\n K-N Kit / Numerical\n N Numerical Only\n\n\n\n Must supply certain offsets, lengths, and / or counts\n depending on what the above split_type is set to.\n Offsets are specified starting at 1.\n\n --ep_pos=i\n --ep_len=i\n\n --pal_pos=i\n --pal_len=i\n\n --ams_seg_pos=i\n --ams_seg_len=i\n\n --kit_pos=i\n --kit_len=i\n\n --max_seg_count=i\n\n How many up?\n --up=i\n\n Disable segment break padding (enabled by default).\n Padding occurs if there are not enough records to\n fill a sheet of paper on a NS break.\n\n --no_pad\n\n Set --lrecl for fixed length processing. Will assume NL terminated\n records otherwise.\n\n --lrecl=i\n\n --verbose\n