in reply to Re^2: reading files to different output files.
in thread reading files to different output files.
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: reading files to different output files.
by ic23oluk (Sexton) on May 31, 2017 at 14:25 UTC | |
by choroba (Cardinal) on May 31, 2017 at 14:53 UTC | |
by shmem (Chancellor) on May 31, 2017 at 15:40 UTC | |
|
Re^4: reading files to different output files.
by ic23oluk (Sexton) on May 31, 2017 at 15:18 UTC |