diff options
author | John Ankarström <john@ankarstrom.se> | 2021-05-06 23:10:04 +0200 |
---|---|---|
committer | John Ankarström <john@ankarstrom.se> | 2021-05-06 23:10:04 +0200 |
commit | 5c747b5231ab20d5a8c2812c009aa9c5039c376b (patch) | |
tree | 42823f3144352308a59d00625e3075452c7c8bd5 | |
parent | fd6ffbd6b8e616a9cbb777a420ecf08aae56d7d6 (diff) | |
download | perlisdead-5c747b5231ab20d5a8c2812c009aa9c5039c376b.tar.gz |
Sort feed entries
-rwxr-xr-x | run/rss | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -16,7 +16,9 @@ my %feeds = ( my $feed = XML::Feed->parse(URI->new($feeds{$name})) or die XML::Feed->errstr; -my @entries = $feed->entries; + +# Sort entries +my @entries = sort { $b->issued <=> $a->issued } $feed->entries; # Print summary of five latest entries for my $entry (@entries[0..4]) { |