open (OUTFILE, ">/path/to/file.txt") or die "Can't open file for text output!\n"; print OUTFILE 'Some text you want to print to the file'; close OUTFILE;