E.g., does perl avoid copying of data in the following cases?
sub large_array { my @large_array; ...populate @large_array... return @large_array; } sub large_array_ref { my $large_array_ref = []; ...populate @$large_array_ref... return $large_array_ref; } # Is the returned array copied? @c = large_array(); @c = @{ large_array_ref() };
In reply to returning large arrays from functions by perl5ever
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |