Perl in a Nutshell

Perl in a NutshellSearch this book
Previous: Reference: forkChapter 5
Function Reference
Next: Reference: getc
 

formline

formline picture, variables

Internal function used by formats, although you may also call it. It formats a list of values (variables) according to the contents of picture, placing the output into the format output accumulator, $^A. When a write is done, the contents of $^A are written to some filehandle, but you could also read $^A yourself and set $^A back to "". Note that 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. Thus, you may need to use multiple formlines to implement a single record-format, like the format compiler.

Be careful if you put double quotes around the picture, since an @ character may be taken to mean the beginning of an array name. formline always returns true. See Section 4.10, "Formats" in Chapter 4 for more information.


Previous: Reference: forkPerl in a NutshellNext: Reference: getc
Reference: forkBook IndexReference: getc