in reply to Copying a tied array
So the question really is: is this how it should be?If it's not documented how perl does it, then you can't make any assumptions about how it does it (or how it might do it in the future).
Is it my own stupid fault for implementing a FETCH method that actually alters the size of the tied array?Yes ;-)
Really, I suppose that the best possible thing might be to add a FETCHALL method to the tiearray interface.No, that would be a BAD idea. All sorts of horrible things start happening in the face of inheritance, eg where someone subclasses a CPAN tied module and overrides FETCH, then a new version of the CPAN module is released that implements the "optional" FETCHALL method, and suddenly the user's own FETCH method is no longer being called. It's for this reason that things like FETCHSLICE haven't been implemented.
Dave.
|
|---|