for my $file (@filenames) { open IN,$file or warn("unable to open $file - $!\n"), next; print OUT ; close IN; }