in reply to is there a file/directory?
If you don't need to know exactly why your program failed, try this
open(INFILE, "infile") && !(-e "outfile") && open (OUTFILE, ">outfile") || die ("Cannot open files\n"); [download]