in reply to Re: Read contents of multiple files into new file and then move source files?
in thread Read contents of multiple files into new file and then move source files?

Thanks, that’s what I was missing, I didn't realize the array was emptied before the handle was closed. Changing the middle portion of the code as suggested works fine, just needed to save the array in another array for later use.
@ARGV = glob('*.txt'); if (@ARGV){ my @MOVE = @ARGV; while (<>) { print $FH $_; $COUNT++; } foreach $FILE (@MOVE) { move($FILE, $OUTDIR) or die "Could not move $FILE to $ +OUTDIR: $!\n"; } }
  • Comment on Re^2: Read contents of multiple files into new file and then move source files?
  • Download Code