E
Ethan Brown
Dear Group--
I'm working on a project where I'm working with large arrays, and I'm
using references to pass arrays around to reduce memory use as much as
possible. I often work with small subsets of a referenced array and
access it like:
my @subrange = @{$big_array_ref}[$start_idx .. $end_idx];
Also, to get the array size, I'll do:
my $num_points = @$big_array_ref;
Is this the best practice? Do I need to be concerned in a statement
like
@{$big_array_ref}[$start_idx .. $end_idx];
that the array referenced by $big_array_ref is being completely copied
before the subrange is taken? Likewise for the $num_points example.
Thanks,
--Ethan Brown
--Keyboards: "The Fabulous Pelicans" (www.pelicans.com)
--In a band? Use http://www.WheresTheGig.com for free.
I'm working on a project where I'm working with large arrays, and I'm
using references to pass arrays around to reduce memory use as much as
possible. I often work with small subsets of a referenced array and
access it like:
my @subrange = @{$big_array_ref}[$start_idx .. $end_idx];
Also, to get the array size, I'll do:
my $num_points = @$big_array_ref;
Is this the best practice? Do I need to be concerned in a statement
like
@{$big_array_ref}[$start_idx .. $end_idx];
that the array referenced by $big_array_ref is being completely copied
before the subrange is taken? Likewise for the $num_points example.
Thanks,
--Ethan Brown
--Keyboards: "The Fabulous Pelicans" (www.pelicans.com)
--In a band? Use http://www.WheresTheGig.com for free.