numeric sort perl
# sort numerically ascending
@articles = sort {$a <=> $b} @files;
# sort numerically descending
@articles = sort {$b <=> $a} @files;
http://www.misc-perl-info.com/perl-sort.html
http://stackoverflow.com/questions/2379315/perl-access-a-hashref-sorted-by-value
@articles = sort {$a <=> $b} @files;
# sort numerically descending
@articles = sort {$b <=> $a} @files;
http://www.misc-perl-info.com/perl-sort.html
http://stackoverflow.com/questions/2379315/perl-access-a-hashref-sorted-by-value

0 Comments:
Post a Comment
<< Home