Skip navigation.
Home
Your source for Perl tips, howto's, faq and tutorials

checking for file existence and/or other attributes

( categories: )

Use the -X operator, where X can be any of the letters listed below:


opening files

( categories: )

- Open a file for reading:

open(FH, "<filename");

- Open a file for writing (truncating the file if it exists):

open(FH, ">filename");

- Open a file for writing in appending mode:

open(FH, ">>filename");

- Open a file for reading and writing:

open(FH, "+<filename");


Syndicate content