in reply to (Expert) Splicing a slice

While your specific slice might make sense, if you consider that you could have @bar = @foo[2,1,2,0];, it becomes nonsense to suggest that a splice on @bar should affect @foo.

You want something different from a slice: a reference to a subarray that could be acted on transparently. You could get that effect by making an object that copies the slice, and has a splice method that performs the requested splice and then splices the resulting value back into the reference array.

Regarding how you plan to use this, I don't see why you don't have an array of two arrayrefs. The first ref would be your arrayref, and the second would be the attributes. Is there some reason you need the structure to be flat? Your description sounds pretty good as a file format, but I'd have the program read it into the structure I describe.


Caution: Contents may have been coded under pressure.