my $largest = @table ? $table[0][0] : undef; for my $y (0..$#table) { my $row = $table[$y]; for my $x (0..$#$row) { $largest = $row->[$x] if $largest < $row->[$x]; } }
Same idea for more dimensions. If the number of dimensions is variable, you can use Algorithm::Loops's NestedLoop.
Update: Fixed bug in code.
In reply to Re: The biggest value in array 2 dimensin
by ikegami
in thread The biggest value in array 2 dimensin
by Bio_student
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |