I have a cgi which is parsing a csv file and displaying the data. It works great and has been satisfactory for a good many months. The people who requested the original work now are asking me to provide a few different views for the data. As it stands the data structure looks like this:
@{$data_struct{$build_no}} = ($build_name,$campus,$audit_date,$cutover +_date,$im)
Primary key is the building number. This is unique.
Since the building number is alpha numeric this is the sort i am using:
return $a =~ /^\w/ ? ($b =~ /^\w/ ?$a cmp $b : 1) : $a <=> $b;
It works fine but I am looking to provide the exact same information but sort(or resort) by building_name or cutover_date.
Has anyone done this sort of thing for hashrefs and can I do it without multiple data transformations? I am really lost as to how to do this...
Help, as always, is much appretiated.
_____________________
mjn
In reply to Sorting Complex Data Scructures by mjn
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |