open(MYFILE,">$myfile");
The Perl command open opens the MYFILE file variable. Then, the > sign tells the Web server that the value of $myfile—textthought.txt—can be overwritten.
If textthought.txt does not exist, the Web server will create the file. If it does exist, then the old file will be completely overwritten with the new data.
TIP: When using the open() command, there are three ways a file can be opened:
> Overwrites an existing file—all previous data is lost
>> Appends data to the end of an existing file
< Used for reading data as an input file