open (READFILE, "<data.txt") or die "File opening failed"; #reading file open (WRITEFILE, ">data.txt") or die "File opening failed"; #writing file