Leser: 2
![]() |
|< 1 2 3 >| | ![]() |
22 Einträge, 3 Seiten |
1
2
3
4
5
6
7
8
9
#!/usr/bin/perl
use strict;
use warnings;
my $newest = shift @{[sort {-M $a > -M $b} (<img*.jpg>)]};
#print $newest, "\n";
unlink 'aktuell.jpg' or die "$!" if -e 'aktuell.jpg';
system "cp $newest aktuell.jpg";
my $newest = shift @{[sort {-M $a > -M $b} (<img*.jpg>)]};
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use FindBin;
my $dir = $FindBin::Bin;# aktuelles verzeichnis
opendir(DIR, $dir) or die $!;
my ($lastM, $fileNewest);
while (my $file = readdir(DIR)) {
next unless $file =~ /\.[Jj][Pp][Gg]$/;
next unless -f "$dir/$file";
if (-M _ > $lastM) {
$lastM = -M _;
$fileNewest = "$dir/$file";
}
} # while
if (defined $lastM) {
print "Datei: $fileNewest\n";
} # if
closedir(DIR);
![]() |
|< 1 2 3 >| | ![]() |
22 Einträge, 3 Seiten |