in reply to Sorting RSS items out of XML::RSS
You can get a lightweight array of the items by just copying the values of %$rss. That will give you a new array whose elements still refer to the original data. The new array can be sorted as you might the original hash, but being an array you can make the sort stick. All you lose are the keys, but perhaps there is other identification in the data.
I've assumed unix times because thay are one of the simplest to sort. Other formats will need other comparisons.my @items = values %$rss; my @sorted_items = sort { $a->{'nzgls'}{'unixtime'} <=> $b->{'nzgls'}{'unixtime'} } @items; # or just # my @sorted_items = sort { # $a->{'nzgls'}{'unixtime'} <=> $b->{'nzgls'}{'unixtime'} # } values %$rss;
After Compline,
Zaxo
|
|---|