=head1 NAME
+X<format> X<report> X<chart>
perlform - Perl formats
to execute; see their entries in L<perlfunc>. Fortunately, the layout is
much more legible, more like BASIC's PRINT USING statement. Think of it
as a poor man's nroff(1).
+X<nroff>
Formats, like packages and subroutines, are declared rather than
executed, so they may occur at any point in your program. (Usually it's
Field definitions are made up from a set of characters, for starting and
extending a field to its desired width. This is the complete set of
characters for field definitions:
+X<format, picture line>
+X<@> X<^> X<< < >> X<< | >> X<< > >> X<#> X<0> X<.> X<...>
+X<@*> X<^*> X<~> X<~~>
@ start of regular field
^ start of special field
- < pad character for left adjustification
+ < pad character for left justification
| pad character for centering
- > pad character for right adjustificat
+ > pad character for right justification
# pad character for a right justified numeric field
0 instead of first #: pad number with leading zeroes
. decimal point within a numeric field
=head2 Text Fields
+X<format, text field>
The length of the field is supplied by padding out the field with multiple
"E<lt>", "E<gt>", or "|" characters to specify a non-numeric field with,
=head2 Numeric Fields
+X<#> X<format, numeric field>
Using "#" as a padding character specifies a numeric field, with
right justification. An optional "." defines the position of the
=head2 The Field @* for Variable Width Multi-Line Text
+X<@*>
The field "@*" can be used for printing multi-line, nontruncated
values; it should (but need not) appear by itself on a line. A final
=head2 The Field ^* for Variable Width One-line-at-a-time Text
+X<^*>
Like "@*", this is a variable width field. The value supplied must be a
scalar variable. Perl puts the first line (up to the first "\n") of the
=head2 Specifying Values
+X<format, specifying values>
The values are specified on the following format line in the same order as
the picture fields. The expressions providing the values must be
=head2 Using Fill Mode
+X<format, fill mode>
On text fields the caret enables a kind of fill mode. Instead of an
arbitrary expression, the value supplied must be a scalar variable
=head2 Suppressing Lines Where All Fields Are Void
+X<format, suppressing lines>
Using caret fields can produce lines where all fields are blank. You can
suppress such lines by putting a "~" (tilde) character anywhere in the
=head2 Repeating Format Lines
+X<format, repeating lines>
If you put two contiguous tilde characters "~~" anywhere into a line,
the line will be repeated until all the fields on the line are exhausted,
=head2 Top of Form Processing
+X<format, top of form> X<top> X<header>
Top-of-form processing is by default handled by a format with the
same name as the current filehandle with "_TOP" concatenated to it.
yourself.
=head2 Format Variables
+X<format variables>
+X<format, variables>
The current format name is stored in the variable C<$~> (C<$FORMAT_NAME>),
and the current top of form format name is in C<$^> (C<$FORMAT_TOP_NAME>).
}
=head2 Footers
+X<format, footer> X<footer>
While $FORMAT_TOP_NAME contains the name of the current header format,
there is no corresponding mechanism to automatically do the same thing
however you like. Not very convenient, but doable.
=head2 Accessing Formatting Internals
+X<format, internals>
For low-level access to the formatting mechanism. you may use formline()
and access C<$^A> (the $ACCUMULATOR variable) directly.