in reply to Re: List::Util max with block
in thread List::Util max with block

Alternative:
my $max = shift(@list); my $max_c = complex_calculation($max); for (@list) { my $c = complex_calculation($_); if ($c > $max_c) { $max = $_; $max_c = $c; } }

Replies are listed 'Best First'.
Re^3: List::Util max with block
by dlarochelle (Sexton) on Nov 08, 2009 at 16:07 UTC
    Thanks ikegami,

    These are both excellent suggestions.