I took your question to mean: "how can I apply Perl sort to this data structure?". This seems to sort your sample data correctly: sort { $a->{date} cmp $b->{date} } @{$data->{news}};Of course, this will do weird things if you have dates from different years since it sorts by month first (I presume those dates are mm-dd-yy). But it should point in the right direction if you want to use a better date comparison routine.
HTH
In reply to Re: sorting complex data
by VSarkiss
in thread sorting complex data
by mexnix
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |