use strict; use warnings; # Declare package names my $work_file; my @files = ; #$work_file = pop; # If work_file comes from command line, uncomment my $inPath = "E:\\triggers\\1_MERGE_3326\\pass"; my $outPath = "E:\\triggers\\1_MERGE_3326\\converted"; foreach $work_file (@files) { open (WORK, "<$work_file") or die "Couldn't open $work_file."; # Open the working file open (my $file, ">$outPath\\$work_file") or die "Couldn't open $work_file."; # open an output file while () { chomp; $_ =~ tr/\000-\011\013\014\016-\037//d; print $file map {"$_\n"} ($_); } # end while close WORK; close $file; } # end foreac