I don't believe you want to rely upon the order, butr add the extra sort to for the key so you know and do not leave it to the current setup and with the next release changes.
 
Wags ;)
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]On Behalf Of Joe Discenza
Sent: Friday, May 05, 2006 08:12
To: perl-win32-users@listserv.ActiveState.com
Subject: Sort not fixing order in equivalent subsequences

Hello all,
 
I can't find anything in the doc about whether Perl's sort function maintaining the order in equivalent subsequences. Suppose I have an array of hashrefs that looks like this:
 
{name => 'a', status => 0}, {name => 'b', status => 1}, {name => 'c', status => 1}, {name => 'd', status => 0}
 
and I sort { $a->{'status'} <=> $b->{'status'} }
 
Should I expect the result (order of the names) to always be ('a', 'd', 'b', 'c'), or could it be, for example, ('d', 'a', 'b', 'c') (i.e., could two entries with the same status value change relative order)?
 
Joe
 

Joseph Discenza, Senior Programmer/Analyst
mailto:[EMAIL PROTECTED]

Carleton Inc. http://www.carletoninc.com
574.243.6040 ext. 300
Fax: 574.243.6060

**********************************************************************

This message contains information that is confidential and proprietary to FedEx Freight or its affiliates. It is intended only for the recipient named and for the express purpose(s) described therein. Any other use is prohibited.

**********************************************************************

 

_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to