$path= "/dir1/dir2/";
$filename= "filename.str";
opendir(MYDIR, $path);
$the_infile = $filename;
$the_outfile = 'fixed_'.$filename;
#open infile, open outfile, write corrections to output file...
closedir(MYDIR);
open(INFILE, '<', $path . $the_infile) || die $!;
open(OUTFILE, '>', $path . $the_outfile) || die $!;
$i=1; #test
$file_in= $filename_list[$i];
$file_out = 'fixed_'.$filename_list[$i];
print "Input File: ", $file_in,"\n";
print "Modified File: ", $file_out,"\n";
$the_infile=$directory_list[$i] . $file_in;
$the_outfile=$directory_list[$i] . $file_out;
print "path in: ", $the_infile,"\n";
print "path out: ", $the_outfile,"\n";
open(INFILE, '<', $the_infile) || die $!;
open(OUTFILE, '>', $the_outfile) || die $!;
Input File: APSET1.turntable.5.str
Modified File: fixed_APSET1.turntable.5.str
path in: /dir1/dir2/APSET1.turntable.5.str
path out: /dir1/dir2/fixed_APSET1.turntable.5.str