% my $sort_param = begin % my $param = shift; % no warnings qw(experimental::smartmatch); %= do { given (param('sort')) { '↑' when ($param); '↓' when ('!' . $param) } } %= ucfirst l $param; % end %= $sort_param->('status'); %= $sort_param->('date'); % if ($folder ne "SENT") { %= $sort_param->('sender'); % } else { % } %= $sort_param->('subject'); %= $sort_param->('size'); % foreach my $msgnum ($first_item .. $last_item) { % my $msg = $msgs->[$msgnum - $first_item]; % }
<%= ucfirst l 'nr' %> <%= ucfirst l 'recipient' %> % if (param('sort') eq "sender") { v % } elsif (param('sort') eq "recipient_rev") { ^ % }
%= $msgnum %= ucfirst($msg->{is_multipart} ? l('yes') : l('no')); % sub d { qr/([[:digit:]]{$_[0]})/ } % my ($year,$mon,$mday,$hour,$min,$sec) = $msg->{date} =~ m/@{[d(4).'-'.d(2).'-'.d(2).'T'.d(2).':'.d(2).':'.d(2).'Z']}/; %= join('/', $mday, $mon, $year) . " $hour:$min"; %= $msg->{from}->[0]->{name} || $msg->{from}->[0]->{email}; <%= $msg->{subject} || '_' %> %= print_sizes10 $msg->{size};