sub example { my @array; $#array = $size_needed; # fill array -- this is where you may save time }