Thread How to sort Array with hashref Elements and custom search function
(5 answers)
Opened by Frank Schuster at 2011-04-14 17:58
Hi.
I want to sort the hasref elements of the array @t in the way that the value from the key 'b' in each anonyme hash should be considered in the sorting process. The result shoud be an array with following order: ( {'b','1','w','10'},{'b','2','w','40'},{'b','3','w','30'}). Code: (dl
)
1 @t = ( {'b','1','w','10'},{'b','3','w','30'},{'b','2','w','40'}); The curios result output of my checking statements is the following: Code: (dl
)
1 10 Why there is just one output of the comparing process ( 1 surrounded by xxx)? Can anybody enlighten me? Regards. mcfaq Last edited: 2011-04-14 18:12:09 +0200 (CEST) |