in reply to creating 2D arrays
I'd like to add just one thing. For performance reasons, i'd rather change the sub mult to return the array reference rather than the array itself. Also, pass an array reference as the second param to mult instead of an array.
sub mult { my ($a, $b) = @_; # dereference the array, process it and create a new array .... return \@c; } ## Assuming that the array @b is a 2D array too for $i (0..$N){ push @results, mult($a, $b[$i]); }
|
|---|