#!/usr/bin/perl use strict; use warnings; opendir DIR,"C:/move/output/test/"; while (my $filename=readdir DIR) { open my $fh, $filename or die "Unable to open $filename: $!"; open OUT,">C:/move/output/test/out.txt"; select OUT;