in reply to Re^7: Why does my get_max_index function return zero? (High Water Mark Algorithm)
in thread Why does my get_max_index function return zero? (High Water Mark Algorithm)
But note also:
c:\@Work\Perl\monks>perl -wMstrict -le "sub get_max_index { my $imax = 0; foreach (@_) { $imax = ($0 .. !$0) if $_ > $_[$imax]; print 'imax ', $imax; } return $imax; } my @arr = (1,2,13,4,5, 99); my $ans = get_max_index(@arr); print $ans; " imax 0 imax 1 imax 2 imax 2 imax 2 imax 3 3
Give a man a fish: <%-{-{-{-<
|
|---|