In input/output operations, filehandle may be a filehandle as opened by the open operator, a predefined filehandle (e.g., STDOUT), or a scalar variable that evaluates to the name of a filehandle to be used.
In scalar context, reads a single line from the file opened on filehandle. In array context, reads the whole file.
Reads from the input stream formed by the files specified in @ARGV, or standard input if no arguments were supplied.
Arranges for the file opened on filehandle to be read or written in binary mode as opposed to text mode (null-operation on UNIX).
Closes the file or pipe associated with the filehandle.
Deprecated, use untie instead.
Deprecated, use tie instead.
Returns true if the next read will return end of file, or if the file is not open.
Returns the EOF status for the last file read.
Indicates EOF on the pseudo file formed of the files listed on the command line.
Implements the fcntl(2) function. This function has nonstandard return values.
Returns the file descriptor for a given (open) file.
Calls flock(2) on the file. operation formed by adding 1 (shared), 2 (exclusive), 4 (non-blocking), or 8 (unlock).
Yields the next character from the file, or an empty string on end of file. If filehandle is omitted, reads from STDIN.
Performs ioctl(2) on the file. This function has nonstandard return values.
Opens a file and associates it with filehandle. If filename is omitted, the scalar variable of the same name as the filehandle must contain the filename.
The following filename conventions apply when opening a file:
Open file for input. Also "<file".
Open file for output, creating it if necessary.
Open file in append mode.
Open file with read/write access.
Opens a pipe to command cmd; forks if cmd is -.
Opens a pipe from command cmd; forks if cmd is -.
Returns a pair of connected pipes.
Prints the elements of list, converting them to strings if needed. If filehandle is omitted, prints by default to standard output (or to the last selected output channel, see select).
Equivalent to print filehandle and sprintf list.
Reads length binary bytes from the file into the variable at offset. Returns number of bytes actually read.
Arbitrarily positions the file. Returns true if successful.
Returns the currently selected filehandle. Sets the current default filehandle for output operations if filehandle is supplied.
Performs a select(2) system call with the same parameters.
Returns a string formatted by (almost all of) the usual printf(3) conventions.
Reads length bytes into $var at offset.
Writes length bytes from scalar at offset.
Returns the current file position for the file. If filehandle is omitted, assumes the file last read.