in reply to find minimum in list

Check out List::Util which became a core module as of 5.7.3
my $min = min @list; my $idx = first { $list[$_] == $min } 0 .. $#list; ## or for duplicates my(@idxs) = grep { $list[$_] == $min } 0 .. $#list;
HTH

_________
broquaint

Replies are listed 'Best First'.
Re: Re: find minimum in list
by scottj (Monk) on Feb 10, 2004 at 21:46 UTC
    Great tips, thanks!