for my $team ( sort {$b->get_wins_total <=> $a->get_wins_total || $b->get_wins_division <=> $a->get_wins_division || $b->get_wins_home <=> $a->get_wins_home || $b->get_runs_scored <=> $a->get_runs_scored || $a->get_runs_allowed <=> $b->get_runs_allowed || $a->get_reg_schedule_id <=> $b->get_reg_schedule_id } @{$self->teams} ) { }
I would like to reduce the sort parameters to a function call, how would I make it like this,
for my $team ( sort standings() @{$self->teams}) { }
Suggestions anyone?
In reply to Refactor my sort by Herkum
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |