Platinum Partner

Sort By Month Name In Perl

Sort by month name


#!/usr/bin/perl -w
#
#
#
use strict;

my @mon = qw( Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec );
my $mon;
@{$mon}{@mon} = (0..$#mon);

my @data = ('Aug', 'Nov', 'Jun');

sub by_month {
    $mon->{$a} <=> $mon->{$b};
}

print join $/, (sort by_month @data);
print $/;
{{ tag }}, {{tag}},

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}
{{ parent.authors[0].realName || parent.author}}

{{ parent.authors[0].tagline || parent.tagline }}

{{ parent.views }} ViewsClicks
Tweet

{{parent.nComments}}