Hash Sorting Problem

2008-02-25 Thread Anirban Adhikary
Dear List I have written the following code . use Data::Dumper; %file = (14 = GGG, 11 = AAA, 101 = EEE, 1 = TTT); print Dumper \%file; @arr1 = sort { $file{$b} cmp $file{$a} } keys %file; #the oldest entry lies at the top position print Dumper

Re: Hash Sorting Problem

2008-02-25 Thread John W. Krahn
Anirban Adhikary wrote: Dear List Hello, I have written the following code . use Data::Dumper; %file = (14 = GGG, 11 = AAA, 101 = EEE, 1 = TTT); print Dumper \%file; @arr1 = sort { $file{$b} cmp $file{$a} } keys %file; #the oldest entry lies at

Re: Hash Sorting Problem

2008-02-25 Thread Anirban Adhikary
Dear List I need to delete each element after every execution of the foreach loop and I need to update sorted the @arr1 after every execution of the foreach loop. I have tried a lot but not able to do this Pls help... Thanks Regards Anirban Adhikary On Mon, Feb 25, 2008

Re: Hash Sorting Problem

2008-02-25 Thread MK
On 02/25/2008 04:32:42 AM, Anirban Adhikary wrote: - Dear List - - I need to delete each element after every execution of the foreach - loop and - I need to update sorted the @arr1 after every execution of the - foreach - loop. I have tried a lot but not able to do this Pls -

Re: Hash Sorting Problem

2008-02-25 Thread Chas. Owens
On Mon, Feb 25, 2008 at 4:32 AM, Anirban Adhikary [EMAIL PROTECTED] wrote: Dear List I need to delete each element after every execution of the foreach loop and I need to update sorted the @arr1 after every execution of the foreach loop. I have tried a lot but not able to do this

Re: Help with end-time start-time sorting problem

2003-01-10 Thread John W. Krahn
Deborah Scott wrote: I have a txt data file that has several fields. Two of the fields are start time and end time (listed in epoch time). I need to write a perl program that finds (and prints) events that occur between midnight last night and midnight tonight. First problem: The date

Help with end-time start-time sorting problem

2003-01-09 Thread Scott, Deborah
I have a txt data file that has several fields. Two of the fields are start time and end time (listed in epoch time). I need to write a perl program that finds (and prints) events that occur between midnight last night and midnight tonight. First problem: The date for midnight last night and

RE: Help with end-time start-time sorting problem

2003-01-09 Thread Wagner, David --- Senior Programmer Analyst --- WGO
PROTECTED] Subject: Help with end-time start-time sorting problem I have a txt data file that has several fields. Two of the fields are start time and end time (listed in epoch time). I need to write a perl program that finds (and prints) events that occur between midnight last night and midnight

RE: Help with end-time start-time sorting problem

2003-01-09 Thread Scott, Deborah
Here's the txt file. Thanks! -Original Message- From: Wagner, David --- Senior Programmer Analyst --- WGO [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 09, 2003 2:32 PM To: Scott, Deborah; [EMAIL PROTECTED] Subject: RE: Help with end-time start-time sorting problem What

Re: Help with end-time start-time sorting problem

2003-01-09 Thread R. Joseph Newton
So what have you treied so far? Although production efficiency may be aided by using prefab cope, the learning process is not. you should probably focus attention to the sections on the time function. You may also want to isolate elements of the localtime return string to check for the

RE: Help with end-time start-time sorting problem

2003-01-09 Thread Scott, Deborah
Yes, I think so. THANKS! This is a great fantastic group. Glad I found it. Have got what you need yet? Wags ;) -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: Help with end-time start-time sorting problem

2003-01-09 Thread Bob Showalter
Scott, Deborah wrote: I have a txt data file that has several fields. Two of the fields are start time and end time (listed in epoch time). I need to write a perl program that finds (and prints) events that occur between midnight last night and midnight tonight. First problem: The date

A little more help on the sorting problem from today

2002-09-26 Thread Steveo
Consider the following form submission data (partial data): match date: September 29 map: Heutau Match 1 USN - 341 (winner) 1st PD - 204 Match 2 GD - 404(winner) RMPZ|SS - 136 Match 3 ITF - 292 RsR - 296(winner) which is sent through a perl script and creates the

Sorting problem

2002-05-06 Thread Richard Adams
Hello, I've got an array of arrays, and want to sort by the 3rd element of the subarray. I then want to print out the sorted array, showing the index and values. E.g., @AoA = ( [23.56, 65.2, 12.4], [13, 56, 87], [45,876, 23], etc ) And then the printout should

RE: Sorting problem

2002-05-06 Thread Nikola Janceski
: Sorting problem Hello, I've got an array of arrays, and want to sort by the 3rd element of the subarray. I then want to print out the sorted array, showing the index and values. E.g., @AoA = ( [23.56, 65.2, 12.4], [13, 56, 87], [45,876, 23], etc

RE: Sorting problem

2002-05-06 Thread Bob Showalter
-Original Message- From: Richard Adams [mailto:[EMAIL PROTECTED]] Sent: Monday, May 06, 2002 10:18 AM To: [EMAIL PROTECTED] Subject: Sorting problem Hello, I've got an array of arrays, and want to sort by the 3rd element of the subarray. I then want to print out the sorted

Re: Sorting problem

2002-05-06 Thread Felix Geerinckx
on Mon, 06 May 2002 14:17:39 GMT, [EMAIL PROTECTED] (Richard Adams) wrote: [Please don't retype code - cut and paste instead] I've tried @sorted = {$a -[2] = $b -[2]} @AoA You forgot the 'sort' function. You put spaces before the '-'. You got the sort order reversed. Try my

Re: Sorting problem

2002-05-06 Thread Michael Lamertz
On Mon, May 06, 2002 at 03:17:39PM +0100, Richard Adams wrote: Hello, I've got an array of arrays, and want to sort by the 3rd element of the subarray. I then want to print out the sorted array, showing the index and values. E.g., Hmm, works for me with the exception of... I've tried

Re: Sorting problem

2002-05-06 Thread Richard Adams
Thanks for all your help...I just forgot the sort in my post... The reason it wasn't working wasn't the sort, it was just that $AoA[0] was undefined.. But sort {$a-[2] = $b-[2]} @AoA[1..$#AoA] works just fine. Thanks again! -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands,

Re: Sorting problem-part2

2002-05-06 Thread Richard Adams
Now I've got an array of hashes, where each hash can have different keys e.g., @aoh = ( {H3 =234, H1 =127, DNA =1, p135 =167}, {H4=24, H3=1550, DNA =25, p39 =67}, {H3 =34, H2A =125, DNA =5, p32 =7}, {H3 =24, H4 =156, DNA =123, p12 =13} ) And I'd like to

RE: Sorting problem-part2

2002-05-06 Thread David Gray
Now I've got an array of hashes, where each hash can have different keys e.g., @aoh = ( {H3 =234, H1 =127, DNA =1, p135 =167}, {H4=24, H3=1550, DNA =25, p39 =67}, {H3 =34, H2A =125, DNA =5, p32 =7}, {H3 =24, H4 =156, DNA =123, p12 =13} ) And

Re: Sorting problem-part2

2002-05-06 Thread Michael Lamertz
On Mon, May 06, 2002 at 12:22:15PM -0400, David Gray wrote: Now I've got an array of hashes, where each hash can have different keys e.g., @aoh = ( {H3 =234, H1 =127, DNA =1, p135 =167}, {H4=24, H3=1550, DNA =25, p39 =67}, {H3 =34, H2A =125, DNA =5, p32

Re: Sorting problem-part2

2002-05-06 Thread Michael Lamertz
Took me some time, but... On Mon, May 06, 2002 at 04:41:03PM +0100, Richard Adams wrote: Now I've got an array of hashes, where each hash can have different keys e.g., @aoh = ( {H3 =234, H1 =127, DNA =1, p135 =167}, {H4=24, H3=1550, DNA =25, p39 =67}, {H3 =34,