Display full error message, and continue

In case anyone is interested: given a function that fills in an array with precious result, but may error halfway, how to I get hold of the data computed before the failure?

If the data is to be returned by a function, but the function throws an error, the return variable is not assigned in the calling namespace.

The tric is to make the function a mutating function: the caller allocates, passes the undef’ed array to the function, which fills half the array before throwing an error: in the caller’s namespace, the array is available and half filed. There’s my pattern!