X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=pod%2Fperlform.pod;h=fac7efca35cb6b87623fecacfc1307da4c856cf8;hb=16114dde8ca7b3eded13218a07f79301ce8c5946;hp=6b65e0430310039ff55bf5ada3435e91287b4b4c;hpb=5a964f204835a8014f4ba86fc91884cff958ac67;p=p5sagit%2Fp5-mst-13.2.git diff --git a/pod/perlform.pod b/pod/perlform.pod index 6b65e04..fac7efc 100644 --- a/pod/perlform.pod +++ b/pod/perlform.pod @@ -60,11 +60,13 @@ justification, or centering. If the variable would exceed the width specified, it is truncated. As an alternate form of right justification, you may also use "#" -characters (with an optional ".") to specify a numeric field. This way -you can line up the decimal points. If any value supplied for these -fields contains a newline, only the text up to the newline is printed. -Finally, the special field "@*" can be used for printing multi-line, -nontruncated values; it should appear by itself on a line. +characters (with an optional ".") to specify a numeric field. This way +you can line up the decimal points. With a "0" (zero) instead of the +first "#", the formatted number will be padded with leading zeroes if +necessary. If any value supplied for these fields contains a newline, +only the text up to the newline is printed. Finally, the special field +"@*" can be used for printing multi-line, nontruncated values; it +should appear by itself on a line. The values are specified on the following line in the same order as the picture fields. The expressions providing the values should be @@ -187,7 +189,7 @@ stage in the expression to single-step the debugger through): If you use the English module, you can even read the variable names: - use English; + use English '-no_match_vars'; $ofh = select(OUTF); $FORMAT_NAME = "My_Other_Format"; $FORMAT_TOP_NAME = "My_Top_Format"; @@ -335,3 +337,12 @@ cannot be controlled by C because the pragma is tied to the block structure of the program, and, for historical reasons, formats exist outside that block structure. See L for further discussion of locale handling. + +Inside of an expression, the whitespace characters \n, \t and \f are +considered to be equivalent to a single space. Thus, you could think +of this filter being applied to each value in the format: + + $value =~ tr/\n\t\f/ /; + +The remaining whitespace character, \r, forces the printing of a new +line if allowed by the picture line.