Perl could recognise that the contents of the internal array, once transfered to the external array, will be garbage collected, and avoid both the copying and the GC, by simple transferring the already allocated and populated internal storage of the internal array to the external array.
COW does not come into it.
In reply to Re^4: returning large arrays from functions
by Anonymous Monk
in thread returning large arrays from functions
by perl5ever
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |