sub sub1{ my @array; for $x (0 .. 100){ $array[$x] = 0; } # omit the part for generating the array; return \@array; }