Leser: 1
|< 1 2 3 >| | 23 Einträge, 3 Seiten |
1
2
3
4
5
6
7
8
9
10
11
12
13
use File::Remove qw(remove);
# removes (without recursion) several files
remove qw( *.c *.pl );
# removes (with recursion) several directories
remove \1, qw( directory1 directory2 );
# removes (with recursion) several files and directories
remove \1, qw( file1 file2 directory1 *~ );
# trashes (with support for undeleting later) several files
trash qw( *~ );
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
use warnings;
use strict;
use File::Remove qw(remove);
sub deletefile {
my $filename = shift;
unless ($filename) {
warn "deletefile: Kein Filename angegeben";
return;
}
unless (-f $filename) {
warn "deletefile: '$filename' existiert nicht";
return;
}
unless ( remove($filename) ) {
warn "deletefile: Konnte '$filename' nicht löschen: $!";
return;
}
return 1;
}
Quoteqw/STRING/
Evaluates to a list of the words extracted out of STRING, using embedded whitespace as the word delimiters. It can be understood as being roughly equivalent to:
split(' ', q/STRING/);
1
2
3
4
5
6
7
8
9
use strict;
filedelete();
sub filedelete {
use File::Remove qw(remove);
remove \1, "'C:\Entwicklung\Perl\projects\Testen\bla'";
}
|< 1 2 3 >| | 23 Einträge, 3 Seiten |