RE: sorting array full of hash references

2005-06-07 Thread Charles K. Clarkson
Jeremy Kister wrote: : I'm stumped on how to sort an array based on a hash refrences's : key in each element of my array. : : this is dumbed down code of what I have: : my @array; : while(my $row = $sth->fetchrow_arrayref){ : my %hash = (id => $row->[0], name => $row->

Re: sorting array full of hash references

2005-06-07 Thread Peter Rabbitson
On Tue, Jun 07, 2005 at 10:40:43PM -0400, Jeremy Kister wrote: > I'm stumped on how to sort an array based on a hash refrences's key in > each element of my array. > > this is dumbed down code of what I have: > my @array; > while(my $row = $sth->fetchrow_arrayref){ > my %hash = (id => $row->[0],

Re: sorting array full of hash references

2005-06-07 Thread John W. Krahn
Jeremy Kister wrote: I'm stumped on how to sort an array based on a hash refrences's key in each element of my array. this is dumbed down code of what I have: my @array; while(my $row = $sth->fetchrow_arrayref){ my %hash = (id => $row->[0], name => $row->[1]); push(@array, \%hash); } after th

sorting array full of hash references

2005-06-07 Thread Jeremy Kister
I'm stumped on how to sort an array based on a hash refrences's key in each element of my array. this is dumbed down code of what I have: my @array; while(my $row = $sth->fetchrow_arrayref){ my %hash = (id => $row->[0], name => $row->[1]); push(@array, \%hash); } after the while loop, I'm tryin