in reply to creating 2D arrays
Your last code should be changed to:
for $i (0..$N){ $results[$i] = [ mult($a,@b[$i]) ]; }
The [] is called an array reference constructor. Without this constructor your array is called in scalar context and it'll just return the number of elements it contains.
Update Fixed my code, thanks to PrakashK, and remove the push.
- Good luck
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: creating 2D arrays
by PrakashK (Pilgrim) on Jul 24, 2001 at 21:09 UTC |