formline
formlinePICTURE,LIST
This is an internal function used by formats, although you may also call it
yourself. It always returns true. It formats a list of values according
to the contents of PICTURE, placing the
output into the format output accumulator, $^A (or $ACCUMULATOR if you use the English module). Eventually, when a write is done, the contents of $^A are written to some filehandle, but you
could also read $^A yourself and then
set $^A back to "". A format typically does one formline per line of form, but the formline function itself doesn’t care how many
newlines are embedded in the PICTURE. This
means that the ~ and ~~ tokens will treat the entire
PICTURE as a single line. You may therefore
need to use multiple formlines to
implement a single record format, just as the format compiler does
internally.
Be careful if you put double quotes around the picture, since an
@ character may be taken to mean the
beginning of an array name. See the section Picture Formats in Chapter 26 for example
uses.
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