in reply to index of the minimum element of the array
C:\>perl -E "@a = (1, 5, 7, 9);use List::Util qw( min max ); my $min = + min @a;say $min;" 1
But, note, using "a" (and "b") as variable names is bad practice because they are special to sort. If you get in the habbit of using a meaningful, multicharacter name -- @array or @arr or @ar in this kind of case -- a non-specific example -- you'll avoid puzzles in the future.
NB also: You posted a dupe moments later. Don't. Register and you'll be able to edit if need be...
/me reddens with embarassment: /me replied to the dupe (Substance up to "NB" was identicial) before noticing that it was a dupe.
And even more chagrin: misread the OP, which clearly asks for "index" rather than value.
|
|---|