my @shrunk = @array[0 .. 5_000]; # Array slice. say size(\@shrunk); # 40072
See also How do I shrink an array in Perl? on StackOverflow.
In reply to Re: Shrunk array takes more memory than original
by choroba
in thread Shrunk array takes more memory than original
by kroach
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |