The_Rev has asked for the wisdom of the Perl Monks concerning the following question:
What is the best way to access a specific location in the array to make changes, and/or check a value?my $matrix_ref; for(0..$length2 { for(0..$length1) { @test = populate($length1); $matrix_ref->[$row][$col] = \@test; } } for(0..$length2) { print "["; for(0..$length1) { print "$matrix_ref->[$row][$col][$_] "; } print "] \n\n"; } } sub populate { my $elements = shift; my @ary; push @ary, $matrix[$element]; $element ++; return @ary; }
Thanks for the help
Edit Masem 2002-03-01 - CODE tags
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Matrix Reference
by jmcnamara (Monsignor) on Mar 01, 2002 at 14:55 UTC | |
|
Re: Matrix Reference
by ton (Friar) on Mar 01, 2002 at 19:24 UTC |