in reply to Re^4: reading files to different output files.
in thread reading files to different output files.
Do you get an error message? If so, why don't you post it?
so what's the problem?
The problem is that you are getting things mixed up. So several problems:
Having fixed that:
while (<>){
This loop reads all files on the commandline line by line, file after file and executes the code enclosed in the loop body, for every line from all files.
Inside the while loop, you iterate over all files again with the foreach(ARGV) inner loop, opening and reading them. You open, read, write all files over and over as many times as all the files have lines, always incrementing $i which gets you quickly past the end of @file_names.
Drop the outer while (<>) loop.
update: But why am I writing you, at all? You didn't give a damn at Re: reading files to different output files., so what...
|
|---|