in reply to Read contents of multiple files into new file and then move source files?
while (<>) {
reads all the files in @ARGV in one go (emptying @ARGV while doing so), so you get to execute the foreach loop only once...
One solution would be to open the files individually using open. Another would be to copy @ARGV into another array, and do the moving afterwards.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Read contents of multiple files into new file and then move source files?
by shadowfox (Beadle) on Feb 10, 2012 at 19:56 UTC |