in reply to Push can shove it.

I can't see any obvious problems except for this:
my (@array, $value) = shift;
You'll end up with a one-element array and nothing in $value. Try:
my (@array, $value) = @_;
Of course, that makes @array slurp up all of the arguments, leaving nothing for $value. Either pass a reference to an array or put the scalars first.

If you assign the results of make_sections() similarly, there's your error.

For debugging purposes, print the contents of @tmp before returning.