use File::Copy; my $src = '/path/to/source/directory'; my $tgt = '/path/to/target/directory'; opendir SRC, $src or die $!; my @files = sort { -M $a <=> -M $b } readdir SRC; shift @files; move("$src/$_", "$tgt/$_") for @files;