in reply to multiple files to multiple files

You should check that opening your files succeeds:

open(my $file1, '<', "input_$i.txt") or die "Couldn't read from 'input_$i.txt': $!"; open(my $file2, '>', "output_$i.txt") or die "Couldn't write to 'output_$i.txt': $!";

If opening $file1 fails, you will never enter the loop and thus won't write anything to $file2.

You might also want to add some progress output to your loop.