#get the names of all .tab files in inbox directory opendir(DIR,$inbox); @files = grep(/\.TAB$/,readdir(DIR)); closedir(DIR); ## loop through the TAB files### foreach $file (@files) { chomp; $verifile = $outbox.$yr.$mn.$day.$hr.$min.$sec."_FIXED.TAB"; open(OUTPUT_FILE, ">>$verifile")||die "Can't open file: $!"; #string manipulation will go here close OUTPUT_FILE; }# end for each file