Formats list according to picture and accumulates the result into $^A
.
Writes a formatted record to the specified file, using the format associated with that file. If filehandle is omitted, the currently selected one is taken.
Formats are defined as follows:
format [ name ] =
formlist
.
formlist is a sequence of lines, each of which is either a comment line (# in the first column), a picture line, or an argument line. A picture line contains descriptions of fields. It can also contain other text that will be output as given. Argument lines contain lists of values that are output in the format and order of the preceding picture line.
name defaults to STDOUT
if omitted.
To associate a format with the current output stream, assign its name to the special variable $~.
A format to handle page breaks can be assigned to $^
. To force a page break on the next write, set $-
to zero.
| Left-adjusted field. Repeat the |
| Right-adjusted field. |
| Centered field. |
| Numeric format with implied decimal point. |
| Same, padded with leading zeros if necessary. |
| Multiline field. |
Use ^
instead of @
for multiline block filling.
Use ~
in a picture line to suppress unwanted empty lines.
Use ~~
in a picture line to have this format line repeated until it would yield a completely blank line. Use with ^
fields to have them repeated until exhausted.
See also $^
, $~
, $^A
, $%
, $:
, $^L
, $-
, and $=
in the section Chapter 36.