Fix perl critic warning, use an anonymous sub
authorVincent Tondellier <tonton+hg@team1664.org>
Tue, 19 Aug 2014 23:58:29 +0200
changeset 44 a5c677eb8329
parent 43 6070307efd38
child 45 efe1a6b5239a
Fix perl critic warning, use an anonymous sub
lib/CrashTest/Storage/FileSystem.pm
--- a/lib/CrashTest/Storage/FileSystem.pm	Tue Aug 19 23:51:31 2014 +0200
+++ b/lib/CrashTest/Storage/FileSystem.pm	Tue Aug 19 23:58:29 2014 +0200
@@ -51,8 +51,8 @@
     }
     closedir $dh;
 
-    sub by_date { $b->{date} <=> $a->{date} };
-    my @sorted_files = sort by_date @files;
+    my $by_date = sub { $b->{date} <=> $a->{date} };
+    my @sorted_files = sort $by_date @files;
 
     my $pager = Data::Page->new();
     $pager->total_entries(scalar @files);