# open input file if (open (INPUTFILE, "mysubdir/myinputfile.txt")) { print "File opened OK \n"; } else { print "Cannot open file\n"; exit; } close INPUTFILE; #close input file and commit changes