Leser: 2
|< 1 2 >| | 15 Einträge, 2 Seiten |
1 2 3 4 5 6 7 8 9 10 11 12 13
my $dir = 'verzeichnis'; opendir DIR, $dir or die $!; my $latest = ( map{ $_->[0] } sort{ $a->[1] <=> $b->[1] } map{ [$_, -M $_] }readdir DIR )[0];
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
my $dir = 'verzeichnis'; opendir DIR, $dir or die $!; my $latest = ( map{ $_->[0] } sort{ $a->[1] <=> $b->[1] } map{ [$_, -M $_] } grep{ -f $_ }readdir DIR )[0];
1 2 3 4
my @array = (1..4); print "@array\n"; @array = map{ $_ * 2 }@array; print "@array\n";
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
#!/usr/bin/perl use strict; use warnings; use Data::Dumper; my $dir = '.'; opendir DIR, $dir or die $!; my @files = readdir DIR; print Dumper(\@files); @files = grep{ -f $_ }@files; print Dumper(\@files); @files = map{ [$_, -M $_] }@files; print Dumper(\@files); @files = sort{ $a->[1] <=> $b->[1] }@files; print Dumper(\@files); @files = map{ $_->[0] }@files; print Dumper(\@files); my $latest = $files[0]; print $latest; closedir DIR;
find . -mindepth 1 -maxdepth 1 -printf '%T@ %p\n' | sort -nr | head -1 | sed 's/^[^ ]* //'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
my $dir = "verzeichnis";
my $latest = (
map{
$_->[0]
}
sort{
$a->[1] <=> $b->[1]
}
map{
[$_, -M $_]
}
grep {
-f $_
}
glob(
$dir."*"))[0];
print $latest;
|< 1 2 >| | 15 Einträge, 2 Seiten |