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.


In reply to Re: Copying a tied array by dave_the_m
in thread Copying a tied array by etcshadow

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.