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) { ... }
In reply to Re: how to sort an array of (Moose) objects
by Corion
in thread how to sort an array of (Moose) objects
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |