While in some cases there's an advantage of storing the
increments instead of the values (it can save space - a
technique also used in sampling (but there's not much to
gain in Perl, except when your numbers would have been
BigInts and your increments aren't)), I don't see the advantage
of your complicated first value. Why not add an imaginary
0 before the orginal list and store just the differences?
(That means, the first value is the first value). The you
only need one pass in both the decoding and encoding.
Abigail