#!/usr/bin/perl # Note: file written.txt must be in same directory, or else # must specify an absolute path open(TXT, ">written.txt"); # open the file for writing print TXT "hello, testing!\n"; # write a line print TXT "end of test.\n"; # write another line close(TXT); # close file again