Name
write
Synopsis
$fh
->write (buf
,len
[,offset
])
Like write
found in C;
that is, the opposite of read
.
The wrapper for the Perl write
function is format_write
.
IO::Handle also provides the following methods, which are not described in detail here because they are simply frontends for the corresponding built-in functions. See Chapter 5 for more information.
Method | Description |
---|---|
| Closes file or pipe |
| Returns |
| Returns file descriptor for a filehandle |
| Returns next character from input file |
| Prints a string or comma-separated list of strings |
| Prints a formatted string |
| Reads data from a filehandle |
| Returns an array of status information for a file |
| Reads data from a filehandle with system call
|
| Writes data to a filehandle with system call
|
| Truncates a file to a specified length |
Finally, the following methods act on the equivalent Perl variables. See Chapter 4 for more information.
Method | Description |
---|---|
| If nonzero, forces a flush now and after each
write or print (default |
| Current page number |
| Current page length (default |
| Number of lines left on page |
| Name of current report format |
| Name of current top-of-page format |
| Current set of linebreak chars for a format |
| Formfeed char used by formats (default
|
| Wrapper for |
Get Perl in a Nutshell, 2nd Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.