-.\" Automatically generated by Pod::Man 2.1801 (Pod::Simple 3.05)
+.\" Automatically generated by Pod::Man 2.25 (Pod::Simple 3.16)
.\"
.\" Standard preamble:
.\" ========================================================================
.\" ========================================================================
.\"
.IX Title "PERLTIDY 1"
-.TH PERLTIDY 1 "2010-12-13" "perl v5.10.0" "User Contributed Perl Documentation"
+.TH PERLTIDY 1 "2014-03-27" "perl v5.14.2" "User Contributed Perl Documentation"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
.PP
This will produce a file \fIsomefile.pl.tdy\fR containing the script reformatted
using the default options, which approximate the style suggested in
-\&\fIperlstyle\fR\|(1). Perltidy never changes the input file.
+\&\fIperlstyle\fR\|(1). The source file \fIsomefile.pl\fR is unchanged.
.PP
.Vb 1
\& perltidy *.pl
already exist, they will be overwritten.
.PP
.Vb 1
+\& perltidy \-b \-bext=\*(Aq/\*(Aq file1.pl file2.pl
+.Ve
+.PP
+Same as the previous example except that the backup files \fIfile1.pl.bak\fR and \fIfile2.pl.bak\fR will be deleted if there are no errors.
+.PP
+.Vb 1
\& perltidy \-gnu somefile.pl
.Ve
.PP
.PP
Most parameters which serve as on/off flags can be negated with a
leading \*(L"n\*(R" (for the short name) or a leading \*(L"no\*(R" or \*(L"no\-\*(R" (for the
-long name). For example, the flag to outdent long quotes is is \fB\-olq\fR
+long name). For example, the flag to outdent long quotes is \fB\-olq\fR
or \fB\-\-outdent\-long\-quotes\fR. The flag to skip this is \fB\-nolq\fR
or \fB\-\-nooutdent\-long\-quotes\fR or \fB\-\-no\-outdent\-long\-quotes\fR.
.PP
.IP "\fB\-b\fR, \fB\-\-backup\-and\-modify\-in\-place\fR" 4
.IX Item "-b, --backup-and-modify-in-place"
Modify the input file or files in-place and save the original with the
-extension \fI.bak\fR. Any existing \fI.bak\fR file will be deleted. See next item
-for changing the default backup extension.
+extension \fI.bak\fR. Any existing \fI.bak\fR file will be deleted. See next
+item for changing the default backup extension, and for eliminating the
+backup file altogether.
.Sp
-A \fB\-b\fR flag will be ignored if input is from standard input, or
-if the \fB\-html\fR flag is set.
+A \fB\-b\fR flag will be ignored if input is from standard input or goes to
+standard output, or if the \fB\-html\fR flag is set.
+.Sp
+In particular, if you want to use both the \fB\-b\fR flag and the \fB\-pbp\fR
+(\-\-perl\-best\-practices) flag, then you must put a \fB\-nst\fR flag after the
+\&\fB\-pbp\fR flag because it contains a \fB\-st\fR flag as one of its components,
+which means that output will go to the standard output stream.
.IP "\fB\-bext\fR=ext, \fB\-\-backup\-file\-extension\fR=ext" 4
.IX Item "-bext=ext, --backup-file-extension=ext"
-Change the extension of the backup file to be something other than the
-default \fI.bak\fR. See \*(L"Specifying File Extensions\*(R".
+This parameter serves two purposes: (1) to change the extension of the backup
+file to be something other than the default \fI.bak\fR, and (2) to indicate
+that no backup file should be saved.
+.Sp
+To change the default extension to something other than \fI.bak\fR see
+\&\*(L"Specifying File Extensions\*(R".
+.Sp
+A backup file of the source is always written, but you can request that it
+be deleted at the end of processing if there were no errors. This is risky
+unless the source code is being maintained with a source code control
+system.
+.Sp
+To indicate that the backup should be deleted include one forward slash,
+\&\fB/\fR, in the extension. If any text remains after the slash is removed
+it will be used to define the backup file extension (which is always
+created and only deleted if there were no errors).
+.Sp
+Here are some examples:
+.Sp
+.Vb 5
+\& Parameter Extension Backup File Treatment
+\& <\-bext=bak> F<.bak> Keep (same as the default behavior)
+\& <\-bext=\*(Aq/\*(Aq> F<.bak> Delete if no errors
+\& <\-bext=\*(Aq/backup\*(Aq> F<.backup> Delete if no errors
+\& <\-bext=\*(Aqoriginal/\*(Aq> F<.original> Delete if no errors
+.Ve
.IP "\fB\-w\fR, \fB\-\-warning\-output\fR" 4
.IX Item "-w, --warning-output"
Setting \fB\-w\fR causes any non-critical warning
set of \fI.perltidyrc\fR files to avoid unwanted code tidying. See also
\&\*(L"Skipping Selected Sections of Code\*(R" for a way to avoid tidying specific
sections of code.
+.IP "\fB\-i=n\fR, \fB\-\-indent\-columns=n\fR" 4
+.IX Item "-i=n, --indent-columns=n"
+Use n columns per indentation level (default n=4).
.IP "\fB\-l=n\fR, \fB\-\-maximum\-line\-length=n\fR" 4
.IX Item "-l=n, --maximum-line-length=n"
The default maximum line length is n=80 characters. Perltidy will try
to find line break points to keep lines below this length. However, long
quotes and side comments may cause lines to exceed this length.
Setting \fB\-l=0\fR is equivalent to setting \fB\-l=(a large number)\fR.
-.IP "\fB\-i=n\fR, \fB\-\-indent\-columns=n\fR" 4
-.IX Item "-i=n, --indent-columns=n"
-Use n columns per indentation level (default n=4).
+.IP "\fB\-vmll\fR, \fB\-\-variable\-maximum\-line\-length\fR" 4
+.IX Item "-vmll, --variable-maximum-line-length"
+A problem arises using a fixed maximum line length with very deeply nested code
+and data structures because eventually the amount of leading whitespace used
+for indicating indentation takes up most or all of the available line width,
+leaving little or no space for the actual code or data. One solution is to use
+a vary long line length. Another solution is to use the \fB\-vmll\fR flag, which
+basically tells perltidy to ignore leading whitespace when measuring the line
+length.
+.Sp
+To be precise, when the \fB\-vmll\fR parameter is set, the maximum line length of a
+line of code will be M+L*I, where
+.Sp
+.Vb 3
+\& M is the value of \-\-maximum\-line\-length=M (\-l=M), default 80,
+\& I is the value of \-\-indent\-columns=I (\-i=I), default 4,
+\& L is the indentation level of the line of code
+.Ve
+.Sp
+When this flag is set, the choice of breakpoints for a block of code should be
+essentially independent of its nesting depth. However, the absolute line
+lengths, including leading whitespace, can still be arbitrarily large. This
+problem can be avoided by including the next parameter.
+.Sp
+The default is not to do this (\fB\-nvmll\fR).
+.IP "\fB\-wc=n\fR, \fB\-\-whitespace\-cycle=n\fR" 4
+.IX Item "-wc=n, --whitespace-cycle=n"
+This flag also addresses problems with very deeply nested code and data
+structures. When the nesting depth exceeds the value \fBn\fR the leading
+whitespace will be reduced and start at a depth of 1 again. The result is that
+blocks of code will shift back to the left rather than moving arbitrarily far
+to the right. This occurs cyclically to any depth.
+.Sp
+For example if one level of indentation equals 4 spaces (\fB\-i=4\fR, the default),
+and one uses \fB\-wc=15\fR, then if the leading whitespace on a line exceeds about
+4*15=60 spaces it will be reduced back to 4*1=4 spaces and continue increasing
+from there. If the whitespace never exceeds this limit the formatting remains
+unchanged.
+.Sp
+The combination of \fB\-vmll\fR and \fB\-wc=n\fR provides a solution to the problem of
+displaying arbitrarily deep data structures and code in a finite window,
+although \fB\-wc=n\fR may of course be used without \fB\-vmll\fR.
+.Sp
+The default is not to use this, which can also be indicated using \fB\-wc=0\fR.
.IP "tabs" 4
.IX Item "tabs"
Using tab characters will almost certainly lead to future portability
option, and if these options are also given, then a warning message will
be issued and this flag will be unset. One example is the \fB\-lp\fR
option.
+.IP "\fB\-dt=n\fR, \fB\-\-default\-tabsize=n\fR" 4
+.IX Item "-dt=n, --default-tabsize=n"
+If the first line of code passed to perltidy contains leading tabs but no
+tab scheme is specified for the output stream then perltidy must guess how many
+spaces correspond to each leading tab. This number of spaces \fBn\fR
+corresponding to each leading tab of the input stream may be specified with
+\&\fB\-dt=n\fR. The default is \fBn=8\fR.
+.Sp
+This flag has no effect if a tab scheme is specified for the output stream,
+because then the input stream is assumed to use the same tab scheme and
+indentation spaces as for the output stream (any other assumption would lead to
+unstable editing).
.RE
.RS 4
.RE
If perl reports errors in the input file, they will not be reported in
the error output unless the \fB\-\-warning\-output\fR flag is given.
.Sp
-The default is \fBnot\fR to do this type of syntax checking (although
+The default is \fB\s-1NOT\s0\fR to do this type of syntax checking (although
perltidy will still do as much self-checking as possible). The reason
is that it causes all code in \s-1BEGIN\s0 blocks to be executed, for all
modules being used, and this opens the door to security issues and
.IP "\fB\-it=n\fR, \fB\-\-iterations=n\fR" 4
.IX Item "-it=n, --iterations=n"
This flag causes perltidy to do \fBn\fR complete iterations. The reason for this
-flag is that code beautification is a somewhat iterative process and in some
+flag is that code beautification is an iterative process and in some
cases the output from perltidy can be different if it is applied a second time.
For most purposes the default of \fBn=1\fR should be satisfactory. However \fBn=2\fR
can be useful when a major style change is being made, or when code is being
-beautified on check-in to a source code control system. The run time will be
-approximately proportional to \fBn\fR, and it should seldom be necessary to use a
-value greater than \fBn=2\fR. This flag has no effect when perltidy is used to generate html.
+beautified on check-in to a source code control system. It has been found to
+be extremely rare for the output to change after 2 iterations. If a value
+\&\fBn\fR is greater than 2 is input then a convergence test will be used to stop
+the iterations as soon as possible, almost always after 2 iterations. See
+the next item for a simplified iteration control.
+.Sp
+This flag has no effect when perltidy is used to generate html.
+.IP "\fB\-conv\fR, \fB\-\-converge\fR" 4
+.IX Item "-conv, --converge"
+This flag is equivalent to \fB\-it=4\fR and is included to simplify iteration
+control. For all practical purposes one either does or does not want to be
+sure that the output is converged, and there is no penalty to using a large
+iteration limit since perltidy will check for convergence and stop iterating as
+soon as possible. The default is \fB\-nconv\fR (no convergence check). Using
+\&\fB\-conv\fR will approximately double run time since normally one extra iteration
+is required to verify convergence.
.SS "Code Indentation Control"
.IX Subsection "Code Indentation Control"
.IP "\fB\-ci=n\fR, \fB\-\-continuation\-indentation=n\fR" 4
.IX Item "-sil=n --starting-indentation-level=n"
By default, perltidy examines the input file and tries to determine the
starting indentation level. While it is often zero, it may not be
-zero for a code snippet being sent from an editing session. If the
-default method does not work correctly, or you want to change the
+zero for a code snippet being sent from an editing session.
+.Sp
+To guess the starting indentation level perltidy simply assumes that
+indentation scheme used to create the code snippet is the same as is being used
+for the current perltidy process. This is the only sensible guess that can be
+made. It should be correct if this is true, but otherwise it probably won't.
+For example, if the input script was written with \-i=2 and the current peltidy
+flags have \-i=4, the wrong initial indentation will be guessed for a code
+snippet which has non-zero initial indentation. Likewise, if an entabbing
+scheme is used in the input script and not in the current process then the
+guessed indentation will be wrong.
+.Sp
+If the default method does not work correctly, or you want to change the
starting level, use \fB\-sil=n\fR, to force the starting level to be n.
.IP "List indentation using \fB\-lp\fR, \fB\-\-line\-up\-parentheses\fR" 4
.IX Item "List indentation using -lp, --line-up-parentheses"
.IX Item "-icp, --indent-closing-paren"
The \fB\-icp\fR flag is equivalent to
\&\fB\-cti=2\fR, described in the previous section. The \fB\-nicp\fR flag is
-equivalent \fB\-cti=0\fR. They are included for backwards compatability.
+equivalent \fB\-cti=0\fR. They are included for backwards compatibility.
.IP "\fB\-icb\fR, \fB\-\-indent\-closing\-brace\fR" 4
.IX Item "-icb, --indent-closing-brace"
The \fB\-icb\fR option gives one extra level of indentation to a brace which
.IP "\fB\-okw\fR, \fB\-\-outdent\-keywords\fR" 4
.IX Item "-okw, --outdent-keywords"
.PD
-The command \fB\-okw\fR will will cause certain leading control keywords to
+The command \fB\-okw\fR will cause certain leading control keywords to
be outdented by 2 spaces (or whatever \fB\-ci\fR has been set to), if
possible. By default, these keywords are \f(CW\*(C`redo\*(C'\fR, \f(CW\*(C`next\*(C'\fR, \f(CW\*(C`last\*(C'\fR,
\&\f(CW\*(C`goto\*(C'\fR, and \f(CW\*(C`return\*(C'\fR. The intention is to make these control keywords
\& %bf = map { $_ => \-M $_ } grep {/\e.deb$/} dirents \*(Aq.\*(Aq; # \-bbt=1
\& %bf = map {$_ => \-M $_} grep {/\e.deb$/} dirents \*(Aq.\*(Aq; # \-bbt=2
.Ve
+.Sp
+To simplify input in the case that all of the tightness flags have the same
+value <n>, the parameter <\-act=n> or \fB\-\-all\-containers\-tightness=n\fR is an
+abbreviation for the combination <\-pt=n \-sbt=n \-bt=n \-bbt=n>.
+.IP "\fB\-tso\fR, \fB\-\-tight\-secret\-operators\fR" 4
+.IX Item "-tso, --tight-secret-operators"
+The flag \fB\-tso\fR causes certain perl token sequences (secret operators)
+which might be considered to be a single operator to be formatted \*(L"tightly\*(R"
+(without spaces). The operators currently modified by this flag are:
+.Sp
+.Vb 1
+\& 0+ +0 ()x!! ~~<> ,=> =( )=
+.Ve
+.Sp
+For example the sequence \fB0 +\fR, which converts a string to a number,
+would be formatted without a space: \fB0+\fR when the \fB\-tso\fR flag is set. This
+flag is off by default.
.IP "\fB\-sts\fR, \fB\-\-space\-terminal\-semicolon\fR" 4
.IX Item "-sts, --space-terminal-semicolon"
Some programmers prefer a space before all terminal semicolons. The
\& my( $a, $b, $c ) = @_; # \-nsak="my local our"
.Ve
.Sp
+The abbreviation \fB\-nsak='*'\fR is equivalent to including all of the
+keywords in the above list.
+.Sp
+When both \fB\-nsak=s\fR and \fB\-sak=s\fR commands are included, the \fB\-nsak=s\fR
+command is executed first. For example, to have space after only the
+keywords (my, local, our) you could use \fB\-nsak=\*(L"*\*(R" \-sak=\*(L"my local our\*(R"\fR.
+.Sp
To put a space after all keywords, see the next item.
.IP "Space between all keywords and opening parens" 4
.IX Item "Space between all keywords and opening parens"
multi-line \f(CW\*(C`qw\*(C'\fR quotes to be left unchanged. This option will not
normally be necessary, but was added for testing purposes, because in
some versions of perl, trimming \f(CW\*(C`qw\*(C'\fR quotes changes the syntax tree.
+.IP "Trimming trailing whitespace from lines of \s-1POD\s0" 4
+.IX Item "Trimming trailing whitespace from lines of POD"
+\&\fB\-trp\fR or \fB\-\-trim\-pod\fR will remove trailing whitespace from lines of \s-1POD\s0.
+The default is not to do this.
.SS "Comment Controls"
.IX Subsection "Comment Controls"
Perltidy has a number of ways to control the appearance of both block comments
.IP "\fB\-fpsc=n\fR, \fB\-\-fixed\-position\-side\-comment=n\fR" 4
.IX Item "-fpsc=n, --fixed-position-side-comment=n"
This parameter tells perltidy to line up side comments in column number \fBn\fR
-whenever possible. The default, n=0, is not do do this.
+whenever possible. The default, n=0, will not do this.
+.IP "\fB\-iscl\fR, \fB\-\-ignore\-side\-comment\-lengths\fR" 4
+.IX Item "-iscl, --ignore-side-comment-lengths"
+This parameter causes perltidy to ignore the length of side comments when
+setting line breaks. The default, \fB\-niscl\fR, is to include the length of
+side comments when breaking lines to stay within the length prescribed
+by the \fB\-l=n\fR maximum line length parameter. For example, the following
+long single line would remain intact with \-l=80 and \-iscl:
+.Sp
+.Vb 2
+\& perltidy \-l=80 \-iscl
+\& $vmsfile =~ s/;[\ed\e\-]*$//; # Clip off version number; we can use a newer version as well
+.Ve
+.Sp
+whereas without the \-iscl flag the line will be broken:
+.Sp
+.Vb 3
+\& perltidy \-l=80
+\& $vmsfile =~ s/;[\ed\e\-]*$//
+\& ; # Clip off version number; we can use a newer version as well
+.Ve
.IP "\fB\-hsc\fR, \fB\-\-hanging\-side\-comments\fR" 4
.IX Item "-hsc, --hanging-side-comments"
By default, perltidy tries to identify and align \*(L"hanging side
\& } ## end foreach my $foo (sort { $b cmp $a ...
.Ve
.Sp
-However this causes a problem with editors editors which cannot recognize
+However this causes a problem with editors which cannot recognize
comments or are not configured to do so because they cannot \*(L"bounce\*(R" around in
the text correctly. The \fB\-cscb\fR flag has been added to
help them by appending appropriate balancing structure:
single '#'.
.IP "\fB\-osbc\fR, \fB\-\-outdent\-static\-block\-comments\fR" 4
.IX Item "-osbc, --outdent-static-block-comments"
-The command \fB\-osbc\fR will will cause static block comments to be outdented by 2
+The command \fB\-osbc\fR will cause static block comments to be outdented by 2
spaces (or whatever \fB\-ci=n\fR has been set to), if possible.
.RE
.RS 4
.IP "\fB\-ssc\fR, \fB\-\-static\-side\-comments\fR" 4
.IX Item "-ssc, --static-side-comments"
When \fB\-ssc\fR is used, a side comment with a static leading pattern, which is
-\&\f(CW\*(C`##\*(C'\fR by default, will be be spaced only a single space from previous
+\&\f(CW\*(C`##\*(C'\fR by default, will be spaced only a single space from previous
character, and it will not be vertically aligned with other side comments.
.Sp
The default is \fB\-nssc\fR.
\& };
.Ve
.Sp
-The flag \fB\-otr\fR is actually a synonym for three other flags
+The flag \fB\-otr\fR is actually an abbreviation for three other flags
which can be used to control parens, hash braces, and square brackets
separately if desired:
.Sp
The rules for \fB\-vtc=1\fR are designed to maintain a reasonable balance
between tightness and readability in complex lists.
.IP "\(bu" 4
-Different controls may be applied to to different token types,
+Different controls may be applied to different token types,
and it is also possible to control block braces; see below.
.IP "\(bu" 4
Finally, please note that these vertical tightness flags are merely
\&\f(CW\*(C`perltidy \-bli \-bbvt=1 \-bbvtl=\*(Aqif elsif else\*(Aq\*(C'\fR.
.Sp
There is no vertical tightness control for closing block braces; with
-the exception of one-line blocks, they will normally remain on a
-separate line.
+one exception they will be placed on separate lines.
+The exception is that a cascade of closing block braces may
+be stacked on a single line. See \fB\-scbb\fR.
.IP "\fB\-sot\fR, \fB\-\-stack\-opening\-tokens\fR and related flags" 4
.IX Item "-sot, --stack-opening-tokens and related flags"
The \fB\-sot\fR flag tells perltidy to \*(L"stack\*(R" opening tokens
For detailed control of individual closing tokens the following
controls can be used:
.Sp
-.Vb 3
+.Vb 4
\& \-sop or \-\-stack\-opening\-paren
\& \-sohb or \-\-stack\-opening\-hash\-brace
\& \-sosb or \-\-stack\-opening\-square\-bracket
+\& \-sobb or \-\-stack\-opening\-block\-brace
.Ve
.Sp
-The flag \fB\-sot\fR is a synonym for \fB\-sop \-sohb \-sosb\fR.
+The flag \fB\-sot\fR is an abbreviation for \fB\-sop \-sohb \-sosb\fR.
+.Sp
+The flag \fB\-sobb\fR is a abbreviation for \fB\-bbvt=2 \-bbvtl='*'\fR. This
+will case a cascade of opening block braces to appear on a single line,
+although this an uncommon occurrence except in test scripts.
.IP "\fB\-sct\fR, \fB\-\-stack\-closing\-tokens\fR and related flags" 4
.IX Item "-sct, --stack-closing-tokens and related flags"
The \fB\-sct\fR flag tells perltidy to \*(L"stack\*(R" closing tokens
For detailed control of the stacking of individual closing tokens the
following controls can be used:
.Sp
-.Vb 3
+.Vb 4
\& \-scp or \-\-stack\-closing\-paren
\& \-schb or \-\-stack\-closing\-hash\-brace
\& \-scsb or \-\-stack\-closing\-square\-bracket
+\& \-scbb or \-\-stack\-closing\-block\-brace
.Ve
.Sp
-The flag \fB\-sct\fR is a synonym for \fB\-scp \-schb \-scsb\fR.
+The flag \fB\-sct\fR is an abbreviation for stacking the non-block closing
+tokens, \fB\-scp \-schb \-scsb\fR.
+.Sp
+Stacking of closing block braces, \fB\-scbb\fR, causes a cascade of isolated
+closing block braces to be combined into a single line as in the following
+example:
+.Sp
+.Vb 7
+\& # \-scbb:
+\& for $w1 (@w1) {
+\& for $w2 (@w2) {
+\& for $w3 (@w3) {
+\& for $w4 (@w4) {
+\& push( @lines, "$w1 $w2 $w3 $w4\en" );
+\& } } } }
+.Ve
+.Sp
+To simplify input even further for the case in which both opening and closing
+non-block containers are stacked, the flag \fB\-sac\fR or \fB\-\-stack\-all\-containers\fR
+is an abbreviation for \fB\-sot \-sot\fR.
.IP "\fB\-dnl\fR, \fB\-\-delete\-old\-newlines\fR" 4
.IX Item "-dnl, --delete-old-newlines"
By default, perltidy first deletes all old line break locations, and then it
.Ve
.IP "\fB\-cab=n\fR, \fB\-\-comma\-arrow\-breakpoints=n\fR" 4
.IX Item "-cab=n, --comma-arrow-breakpoints=n"
-A comma which follows a comma arrow, '=>', requires special
+A comma which follows a comma arrow, '=>', is given special
consideration. In a long list, it is common to break at all such
commas. This parameter can be used to control how perltidy breaks at
these commas. (However, it will have no effect if old comma breaks are
being forced because \fB\-boc\fR is used). The possible values of \fBn\fR are:
.Sp
-.Vb 6
+.Vb 10
\& n=0 break at all commas after =>
-\& n=1 stable: break at all commas after => unless this would break
-\& an existing one\-line container (default)
-\& n=2 break at all commas after =>, but try to form the maximum
+\& n=1 stable: break at all commas after => if container is open,
+\& EXCEPT FOR one\-line containers
+\& n=2 break at all commas after =>, BUT try to form the maximum
\& maximum one\-line container lengths
-\& n=3 do not treat commas after => specially at all
+\& n=3 do not treat commas after => specially at all
+\& n=4 break everything: like n=0 but ALSO break a short container with
+\& a => not followed by a comma when \-vt=0 is used
+\& n=5 stable: like n=1 but ALSO break at open one\-line containers when
+\& \-vt=0 is used (default)
.Ve
.Sp
For example, given the following single line, perltidy by default will
.Sp
If perltidy is subsequently run with this container broken, then by
default it will break after each '=>' because the container is now
-broken. To reform a one-line container, the parameter \fB\-cab=2\fR would
-be needed.
+broken. To reform a one-line container, the parameter \fB\-cab=2\fR could
+be used.
.Sp
The flag \fB\-cab=3\fR can be used to prevent these commas from being
treated specially. In this case, an item such as \*(L"01\*(R" => 31 is
By default, if a conditional (ternary) operator is broken at a \f(CW\*(C`:\*(C'\fR,
then it will remain broken. To prevent this, and thereby
form longer lines, use \fB\-nbot\fR.
+.IP "\fB\-boa\fR, \fB\-\-break\-at\-old\-attribute\-breakpoints\fR" 4
+.IX Item "-boa, --break-at-old-attribute-breakpoints"
+By default, if an attribute list is broken at a \f(CW\*(C`:\*(C'\fR in the source file, then
+it will remain broken. For example, given the following code, the line breaks
+at the ':'s will be retained:
+.Sp
+.Vb 4
+\& my @field
+\& : field
+\& : Default(1)
+\& : Get(\*(AqName\*(Aq => \*(Aqfoo\*(Aq) : Set(\*(AqName\*(Aq);
+.Ve
+.Sp
+If the attributes are on a single line in the source code then they will remain
+on a single line if possible.
+.Sp
+To prevent this, and thereby always form longer lines, use \fB\-nboa\fR.
.IP "\fB\-iob\fR, \fB\-\-ignore\-old\-breakpoints\fR" 4
.IX Item "-iob, --ignore-old-breakpoints"
Use this flag to tell perltidy to ignore existing line breaks to the
.Sp
The statements are still subject to the specified value
of \fBmaximum-line-length\fR and will be broken if this
-maximum is exceeed.
+maximum is exceeded.
.SS "Blank Line Control"
.IX Subsection "Blank Line Control"
Blank lines can improve the readability of a script if they are carefully
A blank line will be introduced before a full-line comment. This is the
default. Use \fB\-nbbc\fR or \fB\-\-noblanks\-before\-comments\fR to prevent
such blank lines from being introduced.
+.IP "\fB\-blbs=n\fR, \fB\-\-blank\-lines\-before\-subs=n\fR" 4
+.IX Item "-blbs=n, --blank-lines-before-subs=n"
+The parameter \fB\-blbs=n\fR requests that least \fBn\fR blank lines precede a sub
+definition which does not follow a comment and which is more than one-line
+long. The default is <\-blbs=1>. \fB\s-1BEGIN\s0\fR and \fB\s-1END\s0\fR blocks are included.
+.Sp
+The requested number of blanks statement will be inserted regardless of the
+value of \fB\-\-maximum\-consecutive\-blank\-lines=n\fR (\fB\-mbl=n\fR) with the exception
+that if \fB\-mbl=0\fR then no blanks will be output.
+.Sp
+This parameter interacts with the value \fBk\fR of the parameter \fB\-\-maximum\-consecutive\-blank\-lines=k\fR (\fB\-mbl=k\fR) as follows:
+.Sp
+1. If \fB\-mbl=0\fR then no blanks will be output. This allows all blanks to be suppressed with a single parameter. Otherwise,
+.Sp
+2. If the number of old blank lines in the script is less than \fBn\fR then
+additional blanks will be inserted to make the total \fBn\fR regardless of the
+value of \fB\-mbl=k\fR.
+.Sp
+3. If the number of old blank lines in the script equals or exceeds \fBn\fR then
+this parameter has no effect, however the total will not exceed
+value specified on the \fB\-mbl=k\fR flag.
+.IP "\fB\-blbp=n\fR, \fB\-\-blank\-lines\-before\-packages=n\fR" 4
+.IX Item "-blbp=n, --blank-lines-before-packages=n"
+The parameter \fB\-blbp=n\fR requests that least \fBn\fR blank lines precede a package
+which does not follow a comment. The default is <\-blbp=1>.
+.Sp
+This parameter interacts with the value \fBk\fR of the parameter
+\&\fB\-\-maximum\-consecutive\-blank\-lines=k\fR (\fB\-mbl=k\fR) in the same way as described
+for the previous item \fB\-blbs=n\fR.
.IP "\fB\-bbs\fR, \fB\-\-blanks\-before\-subs\fR" 4
.IX Item "-bbs, --blanks-before-subs"
-A blank line will be introduced before a \fBsub\fR definition, unless it is a
-one-liner or preceded by a comment. A blank line will also be introduced
-before a \fBpackage\fR statement and a \fB\s-1BEGIN\s0\fR and \fB\s-1END\s0\fR block. This is the
-default. The intention is to help display the structure of a program by
-setting off certain key sections of code. This is negated with \fB\-nbbs\fR or
-\&\fB\-\-noblanks\-before\-subs\fR.
+For compatibility with previous versions, \fB\-bbs\fR or \fB\-\-blanks\-before\-subs\fR
+is equivalent to \fI\-blbp=1\fR and \fI\-blbs=1\fR.
+.Sp
+Likewise, \fB\-nbbs\fR or \fB\-\-noblanks\-before\-subs\fR
+is equivalent to \fI\-blbp=0\fR and \fI\-blbs=0\fR.
.IP "\fB\-bbb\fR, \fB\-\-blanks\-before\-blocks\fR" 4
.IX Item "-bbb, --blanks-before-blocks"
A blank line will be introduced before blocks of coding delimited by
a value of \fB0\fR is equivalent to entering a very large number.
.IP "\fB\-mbl=n\fR \fB\-\-maximum\-consecutive\-blank\-lines=n\fR" 4
.IX Item "-mbl=n --maximum-consecutive-blank-lines=n"
-This parameter specifies the maximum number of consecutive
-blank lines which will be output within code sections of a
-script. The default is n=1. If the input file has more
-than n consecutive blank lines, the number will be reduced
-to n. If \fBn=0\fR then no blank lines will be output (unless
-all old blank lines are retained with the \fB\-kbl=2\fR flag of
-the next section).
+This parameter specifies the maximum number of consecutive blank lines which
+will be output within code sections of a script. The default is n=1. If the
+input file has more than n consecutive blank lines, the number will be reduced
+to n except as noted above for the \fB\-blbp\fR and \fB\-blbs\fR parameters. If \fBn=0\fR
+then no blank lines will be output (unless all old blank lines are retained
+with the \fB\-kbl=2\fR flag of the next section).
.Sp
This flag obviously does not apply to pod sections,
here-documents, and quotes.
The default is \fBn=1\fR.
.IP "\fB\-sob\fR, \fB\-\-swallow\-optional\-blank\-lines\fR" 4
.IX Item "-sob, --swallow-optional-blank-lines"
-This is equivalent to \fBkbl=0\fR and is included for compatability with
+This is equivalent to \fBkbl=0\fR and is included for compatibility with
previous versions.
.IP "\fB\-nsob\fR, \fB\-\-noswallow\-optional\-blank\-lines\fR" 4
.IX Item "-nsob, --noswallow-optional-blank-lines"
-This is equivalent to \fBkbl=1\fR and is included for compatability with
+This is equivalent to \fBkbl=1\fR and is included for compatibility with
previous versions.
.SS "Styles"
.IX Subsection "Styles"
\& **= += *= &= <<= &&= \-= /= |= >>= ||= //= .= %= ^= x="
.Ve
.Sp
-Note that the \-st and \-se flags make perltidy act as a filter on one file only.
-These can be overridden with \-nst and \-nse if necessary.
+Please note that this parameter set includes \-st and \-se flags, which make
+perltidy act as a filter on one file only. These can be overridden by placing
+\&\fB\-nst\fR and/or \fB\-nse\fR after the \-pbp parameter.
+.Sp
+Also note that the value of continuation indentation, \-ci=4, is equal to the
+value of the full indentation, \-i=4. In some complex statements perltidy will
+produce nicer results with \-ci=2. This can be implemented by including \-ci=2
+after the \-pbp parameter. For example,
+.Sp
+.Vb 11
+\& # perltidy \-pbp
+\& $self\->{_text} = (
+\& !$section ? \*(Aq\*(Aq
+\& : $type eq \*(Aqitem\*(Aq ? "the $section entry"
+\& : "the section on $section"
+\& )
+\& . (
+\& $page
+\& ? ( $section ? \*(Aq in \*(Aq : \*(Aq\*(Aq ) . "the $page$page_ext manpage"
+\& : \*(Aq elsewhere in this document\*(Aq
+\& );
+\&
+\& # perltidy \-pbp \-ci=2
+\& $self\->{_text} = (
+\& !$section ? \*(Aq\*(Aq
+\& : $type eq \*(Aqitem\*(Aq ? "the $section entry"
+\& : "the section on $section"
+\& )
+\& . (
+\& $page
+\& ? ( $section ? \*(Aq in \*(Aq : \*(Aq\*(Aq ) . "the $page$page_ext manpage"
+\& : \*(Aq elsewhere in this document\*(Aq
+\& );
+.Ve
.SS "Other Controls"
.IX Subsection "Other Controls"
.IP "Deleting selected text" 4
in the \s-1INSTALL\s0 file distributed with perltidy.
.Sp
Under Windows, perltidy will also search for a configuration file named perltidy.ini since Windows does not allow files with a leading period (.).
-Use \f(CW\*(C`perltidy \-dpro\*(C'\fR to see the possbile locations for your system.
+Use \f(CW\*(C`perltidy \-dpro\*(C'\fR to see the possible locations for your system.
An example might be \fIC:\eDocuments and Settings\eAll Users\eperltidy.ini\fR.
.Sp
Another option is the use of the \s-1PERLTIDY\s0 environment variable.
full path of the configuration file in the value of the environment variable.
Ex. PERLTIDY=C:\eDocuments and Settings\eperltidy.ini
.Sp
-The configuation file is free format, and simply a list of parameters, just as
+The configuration file is free format, and simply a list of parameters, just as
they would be entered on a command line. Any number of lines may be used, with
any number of parameters per line, although it may be easiest to read with one
-parameter per line. Blank lines are ignored, and text after a '#' is ignored
-to the end of a line.
+parameter per line. Comment text begins with a #, and there must
+also be a space before the # for side comments. It is a good idea to
+put complex parameters in either single or double quotes.
.Sp
Here is an example of a \fI.perltidyrc\fR file:
.Sp
to standard output and quit. See the section on controlling whitespace
around tokens.
.Sp
+\&\fB\-\-no\-memoize\fR or \fB\-nmem\fR will turn of memoizing.
+Memoization can reduce run time when running perltidy repeatedly in a
+single process. It is on by default but can be deactivated for
+testing with \fB\-nmem\fR.
+.Sp
\&\fB\-DEBUG\fR will write a file with extension \fI.DEBUG\fR for each input file
showing the tokenization of all lines of code.
.IP "Working with MakeMaker, AutoLoader and SelfLoader" 4
specifying an associated list of block types. The type of a block is the name
of the keyword which introduces that block, such as \fBif\fR, \fBelse\fR, or \fBsub\fR.
An exception is a labeled block, which has no keyword, and should be specified
-with just a colon.
+with just a colon. To specify all blocks use \fB'*'\fR.
.PP
For example, the following parameter specifies \f(CW\*(C`sub\*(C'\fR, labels, \f(CW\*(C`BEGIN\*(C'\fR, and
\&\f(CW\*(C`END\*(C'\fR blocks:
.PP
(the meaning of the \-cscl parameter is described above.) Note that
quotes are required around the list of block types because of the
-spaces.
+spaces. For another example, the following list specifies all block types
+for vertical tightness:
+.PP
+.Vb 1
+\& \-bbvtl=\*(Aq*\*(Aq
+.Ve
.SS "Specifying File Extensions"
.IX Subsection "Specifying File Extensions"
Several parameters allow default file extensions to be overridden. For
\& D anl asc aws b bbb bbc bbs bl bli boc bok bol bot ce
\& csc dac dbc dcsc ddf dln dnl dop dp dpro dsc dsm dsn dtt dwls
\& dwrs dws f fll frm fs hsc html ibc icb icp iob isbc lal log
-\& lp lsl ohbr okw ola oll opr opt osbr otr ple ple pod pvl q
+\& lp lsl ohbr okw ola oll opr opt osbr otr ple pod pvl q
\& sbc sbl schb scp scsb sct se sfp sfs skp sob sohb sop sosb sot
\& ssc st sts syn t tac tbc toc tp tqw tsc w x bar kis
.Ve
\&\fIperlstyle\fR\|(1), \fIPerl::Tidy\fR\|(3)
.SH "VERSION"
.IX Header "VERSION"
-This man page documents perltidy version 20101217.
+This man page documents perltidy version 20140328.
.SH "CREDITS"
.IX Header "CREDITS"
Michael Cartmell supplied code for adaptation to \s-1VMS\s0 and helped with
.Ve
.SH "COPYRIGHT"
.IX Header "COPYRIGHT"
-Copyright (c) 2000\-2010 by Steve Hancock
+Copyright (c) 2000\-2012 by Steve Hancock
.SH "LICENSE"
.IX Header "LICENSE"
This package is free software; you can redistribute it and/or modify it