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.
In reply to Re: Read contents of multiple files into new file and then move source files?
by Eliya
in thread Read contents of multiple files into new file and then move source files?
by shadowfox
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |