jiwei800715 has asked for the wisdom of the Perl Monks concerning the following question:
this kind of data is really like table in database,and I want to sort these rows(hash) first by "date" and then by "dataentry", also can easily search result given by "SecID" and "Date".my @AoH=( {secID=>'SZ0001', date=>20090201, dataentry=>1, # dataentry is start address in data file '200902 +01.bin' filename=>'20090201.bin'} {secID=>'SZ0002', date=>'20090201' dataentry=>2, filename=>'20090201.bin'} {secID=>'SZ0001', date=>'20090202' dataentry=>1, filename=>'20090202.bin'} {secID=>'SZ0002', date=>'20090202' dataentry=>2, filename=>'20090202.bin'} )
Is there any better way to go ?
thx
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: AoH sort & search
by grizzley (Chaplain) on Feb 25, 2009 at 12:25 UTC | |
|
Re: AoH sort & search
by Anonymous Monk on Feb 25, 2009 at 12:01 UTC | |
|
Re: AoH sort & search
by Bloodnok (Vicar) on Feb 25, 2009 at 12:38 UTC |