Leg in Deinen Array eine Datei, die nicht existiert.
Und/Oder bau Dir ein Testskript mit dem interessanten Code und führe das mal aus; z.B.:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
use strict;
use warnings;
my @files = (
$0,
'nicht.da.txt',
$0,
);
for my $file ( @files ) {
open my $infh, '<', $file or do { warn "open($file,ro) failed: $!\n"; next; };
print "file is open: $file: ", ref( $infh ), $/;
}
Resultat:
file is open: a3.pl: GLOB
open(nicht.da.txt,ro) failed: No such file or directory
file is open: a3.pl: GLOB
meine Beiträge: I.d.R. alle Angaben ohne Gewähr und auf Linux abgestimmt!
Die Sprache heisst Perl, nicht PERL. - Bitte Crossposts als solche kenntlich machen!