Prev

Perl Notes

Next

Chapter 8.5 Closing a File

Although, a file will be closed automatically whe you exit the program, it's good practice to close it manually when you're finished with it.

To close a file:
Type close(LABEL);,where LABEL is the filehandle.

open(FILE, ">>../myfile.txt");
print FILE "I'm adding text to a file.\n";
close(FILE);


Prev Home Next