Return-Path: Delivered-To: apmail-perl-modperl-archive@www.apache.org Received: (qmail 34268 invoked from network); 14 Aug 2006 03:58:47 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 14 Aug 2006 03:58:47 -0000 Received: (qmail 21041 invoked by uid 500); 14 Aug 2006 03:58:41 -0000 Delivered-To: apmail-perl-modperl-archive@perl.apache.org Received: (qmail 21026 invoked by uid 500); 14 Aug 2006 03:58:41 -0000 Mailing-List: contact modperl-help@perl.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list modperl@perl.apache.org Received: (qmail 21011 invoked by uid 99); 14 Aug 2006 03:58:41 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 13 Aug 2006 20:58:41 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [64.39.170.12] (HELO mail.acorg.com) (64.39.170.12) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 13 Aug 2006 20:58:38 -0700 Received: from [192.168.1.102] (192.168.1.102 [192.168.1.102]) by mail.acorg.com (Postfix) with ESMTP id 46CAA63A73 for ; Sun, 13 Aug 2006 23:58:23 -0400 (EDT) Received: from 127.0.0.1 (AVG SMTP 7.1.405 [268.10.7/411]); Mon, 14 Aug 2006 00:01:49 -0400 Message-ID: <005501c6bf56$5e4c7700$6601a8c0@clarkconnect.lan> From: "Mike OK" To: References: <5cb4d9a00608101331k1d6a963cyace095ac2a764bf0@mail.gmail.com> <002401c6bdb0$81ae37d0$0201a8c0@homeyr0btzmjk1> <002301c6beed$b8375b40$6601a8c0@clarkconnect.lan> Subject: Re: Sort issue Date: Mon, 14 Aug 2006 00:01:49 -0400 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4922.1500 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4925.2800 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N After a few off list hints and hours of searching and reading I have solved the issue. Here is the link to the page I found helpful. Very belated thanks (almost 6 years) goes to Stas Bekman. Mike http://www.gossamer-threads.com/lists/modperl/modperl/35645?search_string=so rt%20subroutine;#35645 ----- Original Message ----- From: "Mike OK" To: Sent: August 13, 2006 11:32 AM Subject: Sort issue > Hi > > I would like to do some custom sorting with some hash data that I have > stored. It will be used in a mod_perl application so I would like to ensure > that the variables are safe and local. My worry is that I plan to call a > subroutine with sort but I have no idea how to pass the variables or if I > even have to. Here is what I am planning. Any advice or links would help. > Thanks a lot. Mike > > @sortedkeys = sort by_field keys(%names); > > sub by_fields { > my ($first_compare,$first_extra) = $names{$a}; > my ($second_compare,$second_extra) = $names{$b}; > ### I am spliting the value to sort on a secondary field other than the > key > ($first_compare <=> $second_compare || $first_extra <=> $second_extra); > } > > > > -- > No virus found in this incoming message. > Checked by AVG Free Edition. > Version: 7.1.405 / Virus Database: 268.10.7/411 - Release Date: 2006-08-07 > >