Opens the file given by
associates it with
is omitted, the
scalar variable of the same name as the
must contain the
filename. (And you must also be careful to use "
" after the
statement rather than "
", because the precedence of
is higher than list operators like
is preceded by either
or nothing, the file
is opened for input (read-only). If
is preceded by
, the file is opened for output. If the file doesn't exist,
it will be created; if the file exists, it will be overwritten with
. Preceding the filename with
opens an output file for appending. For both read and write access,
A filehandle may also be attached to a process by using a piped
If the filename begins with
, the filename is interpreted as
a command to which output is to be piped. If the filename ends
, the filename is interpreted as a command which pipes
input to you.
You may not have an
command that pipes both
in and out.
Any pipe command containing shell metacharacters is passed to
the shell for execution; otherwise, it is executed directly by
Perl. The filename "
" refers to
STDIN, and "
" refers to
non-zero upon success, the undefined value otherwise. If the
a pipe, the return value happens to be the
process ID of the subprocess.