open

openFILEHANDLE,MODE,EXPR,LISTopenFILEHANDLE,MODE,EXPRopenFILEHANDLE,MODE,REFERENCEopenFILEHANDLE,EXPR
The open function associates an internal
FILEHANDLE with an external file
specification given by EXPR or
LIST. It may be called with two or three
arguments (or more if the third argument is a command). When three or
more arguments are present, the second argument specifies the access
MODE in which the file should be opened, and
the remaining argument supplies the actual filename or the command to
execute, depending on the mode. In the case of a command, additional
arguments may be supplied if you wish to invoke the command directly
without involving a shell, much like system or exec. Or the command may be supplied as a
single argument (the third one), in which case the decision to invoke
the shell depends on whether the command contains shell metacharacters.
(Don’t use more than three arguments if the arguments are ordinary
filenames; it won’t work.) If the MODE is not
recognized, open raises an
exception.
As a special case, the three-argument form with a read/write ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access