crmpicco
09-11-2008, 05:30 AM
I currently have this code that sorts an array based on the starttime, however, i'd like to pre-define the sort. Something like the code I have below, starting with stadium, then field, then park.... is this possible? If so, how can I achieve this?
foreach $item (sort { $a->{starttime} <=> $b->{starttime} } @{$place->{items}}) {
# $item->{type} is "stadium"
}
something like.....
foreach $item (sort { qw(stadium field park) } @{$covermorebooking->{items}}) {
Cheers,
Picco
foreach $item (sort { $a->{starttime} <=> $b->{starttime} } @{$place->{items}}) {
# $item->{type} is "stadium"
}
something like.....
foreach $item (sort { qw(stadium field park) } @{$covermorebooking->{items}}) {
Cheers,
Picco