To expand a bit on the correct diagnosis of Anonymous Monk, you are opening the files, but you are not reading from them.
You are trying to read STDIN twice, once here:
my @in = <>;
and once here:
while ( <> ){ ... }
It's not clear to me what that is supposed to achieve.
Then you try to open a filehandle to a list:
open (READ, @in) || die "cannot open @in: $!.\n";
This suggests that you only have a single filename in @in, and that filename does not have a newline appended.
Your program logic alltogether is a bit weird, because in your while loop, you recreate your output files on every pass through the loop. This is most likely not what you want:
while ( <> ){ for (my $i=0; $i<=$#file_names; $i++){ ... } }
Let me suggest a different structure of your program:
You have many parts of that already, but your program isn't structured in the right order.
In reply to Re^3: reading files to different output files.
by Corion
in thread reading files to different output files.
by ic23oluk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |