in reply to how to sort an array of (Moose) objects
How does it fail?
Note that your sort routine as written above does not get array indices but the objects in $a and $b. The syntax for sort is also different. Maybe you want:
foreach my $obj (sort { $a->price <=> $b->price } @ArObj) { ... }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: how to sort an array of (Moose) objects
by Anonymous Monk on Apr 13, 2018 at 17:06 UTC |