Permalink
Browse files

fixed sorting

  • Loading branch information...
1 parent 1094674 commit 49a9640addd9d753fc209ed5747394d67b01d056 root committed May 5, 2016
Showing with 3 additions and 11 deletions.
  1. +3 −11 modules/printengine.pl
View
@@ -18,7 +18,6 @@
use Sys::Mmap;
use Graphics::Framebuffer;
use Time::HiRes;
-#use Sort::Key::Natural qw( natsort );
#import configuration from configuration file
our $cfg = new Config::Simple();
$cfg->read("printengine.cfg");
@@ -216,16 +215,9 @@
} readdir(DIR);
closedir(DIR);
#sort array
-# my @pics_sorted=natsort @pics;
-# print @pics_sorted;
-my @pics_sorted=sort { mask($a) <=> mask($b) } @pics;
-# where mask is a function to return digits and mask out anything else, so
-# integer comparison will work
-sub mask {
- s/[^0-9]//og;
- return $_;
-}
-print @pics_sorted;
+my @pics_sorted=sort { length $a <=> length $b||$a cmp $b } @pics;
+#print @pics_sorted;
+
#builtin framebuffer access
my $fb = Graphics::Framebuffer->new( FB_DEVICE=>$display_device, SPLASH=>0 );

0 comments on commit 49a9640

Please sign in to comment.