Re: sort results in ascending order

2011-03-17 Thread Uri Guttman
> "RD" == Rob Dixon writes: RD> On 17/03/2011 17:22, Shawn H Corey wrote: >> On 11-03-17 01:05 PM, Rob Dixon wrote: >>> >>> If you are uncomfortable with arrays of hash references >> >> Sooner or later every Perl programmer has to become comfortable with >> complex data struct

Re: sort results in ascending order

2011-03-17 Thread Shawn H Corey
On 11-03-17 03:23 PM, Rob Dixon wrote: We have established that Chris's data is numeric. Your code is overkill. No, it's not. Just because this case does not have the join character in the data, does mean it will never happen. What the novice programmer is going to do is decide that this te

Re: sort results in ascending order

2011-03-17 Thread Rob Dixon
On 17/03/2011 18:43, Shawn H Corey wrote: On 11-03-17 02:04 PM, Rob Dixon wrote: A beginners list isn't the place to introduce arbitrarily complex Perl constructs. Replies have to be sensitive to the ability of the OP or they may co On the other hand, telling them to use a kluge to get the re

Re: sort results in ascending order

2011-03-17 Thread Shawn H Corey
On 11-03-17 02:04 PM, Rob Dixon wrote: A beginners list isn't the place to introduce arbitrarily complex Perl constructs. Replies have to be sensitive to the ability of the OP or they may co On the other hand, telling them to use a kluge to get the results they want is very bad advice. Tell t

Re: sort results in ascending order

2011-03-17 Thread Rob Dixon
On 17/03/2011 17:22, Shawn H Corey wrote: On 11-03-17 01:05 PM, Rob Dixon wrote: If you are uncomfortable with arrays of hash references Sooner or later every Perl programmer has to become comfortable with complex data structures. Why not start now? A beginners list isn't the place to intro

Re: sort results in ascending order

2011-03-17 Thread Rob Dixon
On 17/03/2011 17:22, Chris Stinemetz wrote: From: Rob Dixon [mailto:rob.di...@gmx.com] If you are uncomfortable with arrays of hash references, it may be better for you to create an array of records containing just the four fields you are interested in, and then sort that. Such a program is sho

Re: sort results in ascending order

2011-03-17 Thread Shawn H Corey
On 11-03-17 01:05 PM, Rob Dixon wrote: If you are uncomfortable with arrays of hash references Sooner or later every Perl programmer has to become comfortable with complex data structures. Why not start now? -- Just my 0.0002 million dollars worth, Shawn Confusion is the first step

Re: sort results in ascending order

2011-03-17 Thread Rob Dixon
On 16/03/2011 14:58, Chris Stinemetz wrote: > Shawn H Corey wrote: >> On 11-03-16 09:26 AM, Chris Stinemetz wrote: >>> >>> I would like to print results in ascending order starting with $cell, >>> $sect, and finally $carr. >> >> You would need to store the data in a large array, then sort it. >>

Re: sort results in ascending order

2011-03-17 Thread Chas. Owens
On Thu, Mar 17, 2011 at 11:04, Chris Stinemetz wrote: snip > For some reason I am not getting the sorted list in my output file. Instead I > am getting the following: > > bc8) HASH(0x100d0d78) HASH(0x100d15e8) HASH(0x100d0f28) HASH(0x100d0c58) > HASH(0x100d1168) HASH(0x100d1678) snip You are g

Re: sort results in ascending order

2011-03-17 Thread Shawn H Corey
On 11-03-17 11:04 AM, Chris Stinemetz wrote: print OUTFILE "@sorted:\n"; for my $tuple ( @sorted ){ print "$tuple->{cell} $tuple->{sect} $tuple->{carr} $tuple->{RTD}\n"; } -- Just my 0.0002 million dollars worth, Shawn Confusion is the first step of understanding. Pr

RE: sort results in ascending order

2011-03-17 Thread Chris Stinemetz
Good day, Your help is greatly appreciated. Thanks For some reason I am not getting the sorted list in my output file. Instead I am getting the following: bc8) HASH(0x100d0d78) HASH(0x100d15e8) HASH(0x100d0f28) HASH(0x100d0c58) HASH(0x100d1168) HASH(0x100d1678) HASH(0x100d21 70) HASH(0x100d0ce

Re: sort results in ascending order

2011-03-16 Thread Shawn H Corey
On 11-03-16 10:58 AM, Chris Stinemetz wrote: Where would I place print to see the results for validation? Since @sorted contains the sorted data, anywhere after it gets the sorted data. -- Just my 0.0002 million dollars worth, Shawn Confusion is the first step of understanding. Prog

RE: sort results in ascending order

2011-03-16 Thread Chris Stinemetz
Thanks, Where would I place print to see the results for validation? On 11-03-16 09:26 AM, Chris Stinemetz wrote: > I would like to print results in ascending order starting with $cell, $sect, > and finally $carr. You would need to store the data in a large array, then sort it. # untested du

Re: sort results in ascending order

2011-03-16 Thread Shawn H Corey
On 11-03-16 09:26 AM, Chris Stinemetz wrote: I would like to print results in ascending order starting with $cell, $sect, and finally $carr. You would need to store the data in a large array, then sort it. # untested due lack of data my @array = (); while (<>) { chomp; if (/;/) {

sort results in ascending order

2011-03-16 Thread Chris Stinemetz
I would like to print results in ascending order starting with $cell, $sect, and finally $carr. I am getting the error: Name "main::a" used only once: possible typo at ./DOband.pl line 6. Name "main::b" used only once: possible typo at ./DOband.pl line 6. Below is my code. Any help is greatly a