in reply to Help understanding inherited script

First, I would add a use warnings; statement after use strict;. I suspect that some run time errors will surface with this code.

This code is written with column based parsing of the input line(s).
That is what unpack ("a1 a9 a8 a16 a14 a40 a40 a40 a40 a40 a40 a40 a40 a4... is about.
One character, 9 characters, 8 characters, 16 characters,...etc.

"C123456789abcedfghi" parses to "c", "123456789", "abcedfghi". "C 89 hi" parses to "C", "89", "hi".
There are a number of reasons why this is a bad format. But it is what it is.
To add a column, you need to add an "a3" (3 characters, or whatever number) into the unpack and pack statements.
Then add a variable in the assignment statement in the appropriate order.

There are of course quite a number of improvements that could be made. However, to just add a column that is what you need to do.