in reply to Sort by -M
#!/usr/bin/perl # http://perlmonks.org/?node_id=1208341 use strict; use warnings; use Data::Dump 'pp'; my @tmparray = (<d.tree*>, 'nosuchfile'); # for testing purposes... pp \@tmparray; # replace # @tmparray = sort { -M "$b" <=> -M "$a" } (@tmparray); # with @tmparray = map $_->[0], sort { $b->[1] <=> $a->[1] } grep defined $_->[1], map [ $_, -M $_ ], @tmparray; # end replace pp \@tmparray;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Sort by -M
by roperl (Beadle) on Feb 02, 2018 at 20:33 UTC | |
by AnomalousMonk (Archbishop) on Feb 02, 2018 at 23:08 UTC | |
by Marshall (Canon) on Feb 03, 2018 at 09:55 UTC |