This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perldelta for bug #70615 + tweaks
[perl5.git] / pod / perlform.pod
index 6e104bb..3cfa1b7 100644 (file)
@@ -1,4 +1,5 @@
 =head1 NAME
+X<format> X<report> X<chart>
 
 perlform - Perl formats
 
@@ -12,6 +13,7 @@ etc.  Keywords are borrowed from FORTRAN: format() to declare and write()
 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
@@ -54,12 +56,15 @@ literal text. These lines do not undergo any kind of variable interpolation.
 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
@@ -77,6 +82,7 @@ the various possibilities in detail.
 
 
 =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,
@@ -97,6 +103,7 @@ multi-line text block filling; see L</Using Fill Mode> for details.
 
 
 =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
@@ -116,6 +123,7 @@ filled with "#" as overflow evidence.
 
 
 =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
@@ -123,6 +131,7 @@ line feed is chomped off, but all other characters are emitted verbatim.
 
 
 =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 
@@ -145,6 +154,7 @@ The variable will I<not> be restored.
 
 
 =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
@@ -163,6 +173,7 @@ L<perllocale> and L<"WARNINGS"> for more information.
 
 
 =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
@@ -184,6 +195,7 @@ if the text was too long to appear in its entirety.
 
 
 =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
@@ -191,6 +203,7 @@ line.  The tilde will be translated to a space upon output.
 
 
 =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,
@@ -202,6 +215,7 @@ field in such lines, because it will never go blank.
 
 
 =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.
@@ -256,6 +270,8 @@ channel, but you'll have to handle C<$-> (C<$FORMAT_LINES_LEFT>)
 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>).
@@ -365,6 +381,7 @@ Here's a little program that's somewhat like fmt(1):
  }
 
 =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
@@ -381,6 +398,7 @@ Have your child process massage its STDIN to rearrange headers and footers
 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.