MYLOOP: while ( 1 ) { open my $fh1, '<', "$file1" or foobar($file1) and next; # irgendeine Verarbeitung close $fh1; open my $fh2, '<', "$file2" or foobar($file2) and next; # irgendeine Verarbeitung close $fh2; open my $fh3, '<', "$file3" or foobar($file3) and next; # irgendeine Verarbeitung close $fh3; } sub foobar { my $file = shift; print STDERR "unable to open $file: $!\n"; print STDERR "sleep for 3 seconds\n"; sleep 3; print STDERR "wakeup\n"; }