Thread Dateisortierung (39 answers)
Opened by IceRage at 2012-02-04 02:17

pq
 2012-02-04 03:07
#155849 #155849
User since
2003-08-04
12208 Artikel
Admin1
[Homepage]
user image
dann muss irgendwas unter windows kaputt sein.

Code: (dl )
1
2
3
4
5
6
7
8
$ ls -art test
.. foo bar 42 23 999 abcd .
$ perl -wE'
my $dir = "test";
opendir my $dh, "test" or die $!;
my @files = map { $_->[1] } sort { $b->[0] <=> $a->[0] } map { [-M "$dir/$_", $_] } readdir $dh;
say "@files";'
.. foo bar 42 23 999 . abcd
Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live. -- Damian Conway in "Perl Best Practices"
lesen: Wiki:Wie frage ich & perlintro Wiki:brian's Leitfaden für jedes Perl-Problem

View full thread Dateisortierung