Add graceful handling for when optpattern is undefined.
Spelling fix for debug output
Correct a descriptive comment
Improve loop syntax

* compact assignment (don't need interim $_)
* assign to "", so no defined() test needed
* use "substr(-1) ne X" instead of "!~ X", for speed
* remove "-s file" test (redundant after $lastline test)
Add -N option to avoid prepending $AINSL_TARGET
Standardise use of "and,or,&&,||" - respecting precedence

"and,or" have lower precedence than comma/etc, while "&&,||" have higher,
so their use for side-effects future-proofs the code by avoiding various
obscure surprises like in this example, when:

  $x eq "abc" || die;

is edited some time in the future to be:

  $x eq "ab", "c" || die;

which appends:

  "ab"

to:

  "c" || die

(which is always "c") and the statement will never die as expected...
Make anomalous whitespace consistent with other occurrences in the script
Add -N to manpage, improve -h output for it too
add changelog entries