perchance has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl -w use strict; my @array = ( [1,1,1],[2,2,2],[3,3,3] ); for my $i ( 0..2 ) { @{$array[$i]} = (0) x 3; } for my $i ( 0..2 ) { for my $j ( 0..2 ) { print "-".$array[$i][$j]; } print "\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: setting multidimensional array values
by Masem (Monsignor) on May 24, 2001 at 16:57 UTC | |
by da (Friar) on May 24, 2001 at 19:58 UTC | |
|
Re: setting multidimensional array values
by tachyon (Chancellor) on May 24, 2001 at 17:34 UTC | |
|
andye Re: setting multidimensional array values
by andye (Curate) on May 24, 2001 at 17:23 UTC | |
|
Re: setting multidimensional array values
by tachyon (Chancellor) on May 24, 2001 at 17:58 UTC |