Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Problems with custom sort

by amphiplex (Monk)
on Jun 30, 2002 at 14:02 UTC ( #178363=note: print w/replies, xml ) Need Help??


in reply to Problems with custom sort

$a and $b are assigned the actual array elements, not the index to them.
So I believe that this will do what you want:
@sorted = sort {$a->size() <=> $b->size()} @$setarray;
---- kurt

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://178363]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (4)
As of 2022-10-04 03:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My preferred way to holiday/vacation is:











    Results (15 votes). Check out past polls.

    Notices?