Leser: 1
|< 1 2 >| | 14 Einträge, 2 Seiten |
1
2
3
4
5
6
7
8
9
foreach my $files(@files)
{
print "$files\n";
my $quelle = "./$verzeichnis";
my $ziel = "./$folder";
copy("$quelle/$files","$ziel/$files");
}
1
2
3
4
5
6
7
8
9
10
find(\&bedingung, $verzeichniss);
sub bedingung {
if ( $File::Find::name =~ /^$datei$/ )
{
push(@files, $_);
}
return;
}
Quote$File::Find::dir is the current directory name,
$_ is the current filename within that directory
$File::Find::name is the complete pathname to the file.
1 2 3 4 5 6 7 8 9 10 11 12 13
my $pattern = '.+\.xls'; my @files; find( \&wanted, @dirs ), sub wanted { # nur den Dateinamen überprüfen if ( $_ =~ m/^$pattern$/ ) { # kompletten Pfad zur Datei merken push @files, $File::Find::name; } return; }
1 2
copy("$quelle/$files","$ziel/$files") or die "Fehler beim Kopieren von $files: $!";
|< 1 2 >| | 14 Einträge, 2 Seiten |