On Fri, 26 Sep 2003, Jay Ay wrote: > hi there > > i want to be able to sort an array of hashes. > > for example, i create each hash like this and push it on to the array. > push(@senddata,{ 'sender' => $se, 'recip' => $re, 'smtphost' => $svr, > 'number' => $somenbr}); > > what i want to do is sort the array by 'number' key value, in order greatest > number to smallest number. >
I'm pretty sure you've gotten lots of replies to the question you asked so I won't add to the list. I just want to do a little mild course correction to your termanology. The only thing that can ever be pushed into an array is a scalar. Every defined element of an array contains a scalar. What you are actually pushing is a special type of scalar called a reference. In this case a reference to an anonymous hash. If you tried to actually push a hash into an array you'd end up adding one scalar for every key and data element of the hash. **** [EMAIL PROTECTED] <Carl Jolley> **** All opinions are my own and not necessarily those of my employer **** _______________________________________________ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs