Us of uninitialized value $word in substitution

line 2329…
_substitute_characters method iterator function sets range to 1 element
more than the number of words in the array.  Must subtract 1 from the
upper range to correct.