#!/usr/bin/perl use strict; use warnings; my $newest = shift @{[sort {-M $a > -M $b} ()]}; #print $newest, "\n"; unlink 'aktuell.jpg' or die "$!" if -e 'aktuell.jpg'; system "cp $newest aktuell.jpg";