Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
How do I sort that to print in price order? I tried something like this:foreach my $obj (@ArrayofObjects){ $obj->print }
but does not work...What am I missing? Cheers...foreach my $obj (sort @ArObj[$a]->price <=> @ArObj[$b]->price} @ArObj) + { # stuff here ... }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: how to sort an array of (Moose) objects
by Corion (Patriarch) on Apr 13, 2018 at 16:57 UTC | |
by Anonymous Monk on Apr 13, 2018 at 17:06 UTC |