Leser: 1
5 Einträge, 1 Seite |
1
2
3
4
5
6
7
8
9
10
11
12
13
# !/bin/perl -w
$dir = "C:\\temp";
if ((-e "$dir\\*.tif") || (-e "$dir\\*.pdf))
{
print "Tif-files or Pdf-files available\n";
exit;
}else{
print "Tif-files or Pdf-files not available\n";
exit;
}
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
# !/bin/perl use strict; use warnings; my $dir = "C:\\temp"; if(glob("$dir\\*tif")>0 || glob("$dir\\*tif")>0) { print "Tif-files or Pdf-files available\n"; } else { print "Tif-files or Pdf-files not available\n"; } exit
1 2 3 4 5 6 7 8 9 10 11 12
opendir my $dh, $dir or die "$dir: $!\n"; my @wanted = grep { m/\.(?:pd|ti)f\z/ } readdir $dh; closedir $dh; if ( @wanted ) { local $,= local $\ = $/; print "Folgende Dateien gefunden:", @wanted; } else { print "nix gefunden!\n"; }
1
2
3
4
# find all the .pm files in @INC
my @files = File::Find::Rule->file()
->name( '*.pm' )
->in( @INC );
5 Einträge, 1 Seite |