Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Problems with custom sort

by amphiplex (Monk)
on Jun 30, 2002 at 14:02 UTC ( [id://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?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (5)
As of 2024-04-24 18:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found