From f7d696bce1290f0b40dc1ee43f404eff2f71404b Mon Sep 17 00:00:00 2001 From: Marius Gavrilescu Date: Mon, 20 Jan 2014 23:30:07 +0200 Subject: [PATCH] Sort user list by name and exclude users with empty names --- lib/Gruntmaster/Page/Us.pm | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/Gruntmaster/Page/Us.pm b/lib/Gruntmaster/Page/Us.pm index 2095fd5..0a2e78a 100644 --- a/lib/Gruntmaster/Page/Us.pm +++ b/lib/Gruntmaster/Page/Us.pm @@ -9,15 +9,17 @@ our $VERSION = '0.001'; use constant TEMPLATES => { en => <<'HTML', - +
  1. +
HTML }; sub _generate{ my ($self, $htc, $path, $lang) = @_; - $htc->param(users => [ map { {id => $_, name => user_name} } users ]); + $htc->param(users => [ sort { lc $a->{name} cmp lc $b->{name} } + map { {id => $_, name => user_name} } + grep { user_name =~ /\w/ } users ]); } 1 -- 2.39.2