my $thisPath = cwd; my $inputFile = "${thisPath}${ps}inputFileInfo.txt"; my $pathToCheck = "c:${ps}temp"; my $outputFile = "${thisPath}${ps}resultsFile_$timestamp.txt"; open theInputFile, $inputFile or die "Could not read from $inputFile, program halting. \n"; while () { chomp; my $fileBeingChecked = "${pathToCheck}${ps}$_"; open (theOutputFile, '>', $outputFile) or die "Could not open $outputFile. \n"; if (-e $fileBeingChecked) { my $fileSize = -s $fileBeingChecked; my $date_string = ctime(stat($fileBeingChecked)->mtime); print theOutputFile "Yes, $fileSize, $date_string \n"; } else { print theOutputFile "No \n"; } } close (theOutputFile) close (theInputFile)