#!/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;
In reply to Re: Sort by -M
by tybalt89
in thread Sort by -M
by roperl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |