]> git.donarmstrong.com Git - perltidy.git/blobdiff - bin/perltidy
New upstream version 20230309
[perltidy.git] / bin / perltidy
index a24aace57c31444087e392ab00baf170791931cb..73801af9c46aa84fbe882ffc1a5f166fbf387999 100755 (executable)
@@ -35,7 +35,16 @@ perltidy - a perl script indenter and reformatter
 
 =head1 DESCRIPTION
 
-Perltidy reads a perl script and writes an indented, reformatted script.
+Perltidy reads a perl script and writes an indented, reformatted script.  The
+formatting process involves converting the script into a string of tokens,
+removing any non-essential whitespace, and then rewriting the string of tokens
+with whitespace using whatever rules are specified, or defaults.  This happens
+in a series of operations which can be controlled with the parameters described
+in this document.
+
+Perltidy is a commandline frontend to the module Perl::Tidy.  For documentation
+describing how to call the Perl::Tidy module from other applications see the
+separate documentation for Perl::Tidy.  It is the file Perl::Tidy.pod in the source distribution.
 
 Many users will find enough information in L<"EXAMPLES"> to get
 started.  New users may benefit from the short tutorial
@@ -50,8 +59,7 @@ Perltidy can produce output on either of two modes, depending on the
 existence of an B<-html> flag.  Without this flag, the output is passed
 through a formatter.  The default formatting tries to follow the
 recommendations in perlstyle(1), but it can be controlled in detail with
-numerous input parameters, which are described in L<"FORMATTING
-OPTIONS">.
+numerous input parameters, which are described in L<"FORMATTING OPTIONS">.
 
 When the B<-html> flag is given, the output is passed through an HTML
 formatter which is described in L<"HTML OPTIONS">.
@@ -165,7 +173,7 @@ Option names may be terminated early as long as they are uniquely identified.
 For example, instead of B<--dump-token-types>, it would be sufficient to enter
 B<--dump-tok>, or even B<--dump-t>, to uniquely identify this command.
 
-=head2 I/O control
+=head2 I/O Control
 
 The following parameters concern the files which are read and written.
 
@@ -209,7 +217,7 @@ desired with B<-nse> on the command line.
 
 Change the extension of the output file to be F<ext> instead of the
 default F<tdy> (or F<html> in case the -B<-html> option is used).
-See L<Specifying File Extensions>.
+See L<"Specifying File Extensions">.
 
 =item  B<-opath>=path,    B<--output-path>=path
 
@@ -239,6 +247,11 @@ extension F<.bak>.  Any existing F<.bak> file will be deleted.  See next
 item for changing the default backup extension, and for eliminating the
 backup file altogether.
 
+B<Please Note>: Writing back to the input file increases the risk of data loss
+or corruption in the event of a software or hardware malfunction. Before using
+the B<-b> parameter please be sure to have backups and verify that it works
+correctly in your environment and operating system.
+
 A B<-b> flag will be ignored if input is from standard input or goes to
 standard output, or if the B<-html> flag is set.
 
@@ -254,7 +267,7 @@ file to be something other than the default F<.bak>, and (2) to indicate
 that no backup file should be saved.
 
 To change the default extension to something other than F<.bak> see
-L<Specifying File Extensions>.
+L<"Specifying File Extensions">.
 
 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
@@ -274,6 +287,19 @@ Here are some examples:
   <-bext='/backup'>   F<.backup>         Delete if no errors
   <-bext='original/'> F<.original>       Delete if no errors
 
+=item B<-bm=s>,  B<--backup-method=s>
+
+This parameter should not normally be used but is available in the event that
+problems arise as a transition is made from an older implementation of the
+backup logic to a newer implementation.  The newer implementation is the
+default and is specified with B<-bm='copy'>. The older implementation is
+specified with B<-bm='move'>.  The difference is that the older implementation
+made the backup by moving the input file to the backup file, and the newer
+implementation makes the backup by copying the input file.  The newer
+implementation preserves the file system B<inode> value. This may avoid
+problems with other software running simultaneously.  This change was made
+as part of issue B<git #103> at github.
+
 =item B<-w>,    B<--warning-output>
 
 Setting B<-w> causes any non-critical warning
@@ -377,45 +403,6 @@ other words that the input code is 'untidy' according to the formatting
 parameters.  If this is not the case, an error message noting this is produced.
 This flag has no other effect on the functioning of perltidy.
 
-=item B<-sal=s>,   B<--sub-alias-list=s>
-
-This flag causes one or more words to be treated the same as if they were the keyword 'sub'.  The string B<s> contains one or more alias words, separated by spaces or commas.
-
-For example,
-
-        perltidy -sal='method fun _sub M4'
-
-will cause the perltidy to treate the words 'method', 'fun', '_sub' and 'M4' to be treated the same as if they were 'sub'.  Note that if the alias words are separated by spaces then the string of words should be placed in quotes.
-
-Note that several other parameters accept a list of keywords, including 'sub' (see L<Specifying Block Types>).
-You do not need to include any sub aliases in these lists. Just include keyword 'sub' if you wish, and all aliases are automatically included.
-
-=item B<-gal=s>,   B<--grep-alias-list=s>
-
-This flag allows a code block following an external 'list operator' function to be formatted as if it followed one of the builtin keywords B<grep>,  B<map> or B<sort>.  The string B<s> contains the names of one or more such list operators, separated by spaces or commas.
-
-By 'list operator' is meant a function which is invoked in the form
-
-      word {BLOCK} @list
-
-Perltidy tries to keep code blocks for these functions intact, since they are usually short, and does not automatically break after the closing brace since a list may follow. It also does some special handling of continuation indentation.
-
-For example, the code block arguments to functions 'My_grep' and 'My_map' can be given formatting like 'grep' with
-
-        perltidy -gal='My_grep My_map'
-
-By default, the following list operators in List::Util are automatically included:
-
-      all any first none notall reduce reductions
-
-Any operators specified with B<--grep-alias-list> are added to this list.
-The next parameter can be used to remove words from this default list.
-
-=item B<-gaxl=s>,   B<--grep-alias-exclusion-list=s>
-
-The B<-gaxl=s> flag provides a method for removing any of the default list operators given above
-by listing them in the string B<s>.  To remove all of the default operators use B<-gaxl='*'>.
-
 =back
 
 =head1 FORMATTING OPTIONS
@@ -430,7 +417,7 @@ This flag disables all formatting and causes the input to be copied unchanged
 to the output except for possible changes in line ending characters and any
 pre- and post-filters.  This can be useful in conjunction with a hierarchical
 set of F<.perltidyrc> files to avoid unwanted code tidying.  See also
-L<Skipping Selected Sections of Code> for a way to avoid tidying specific
+L<"Skipping Selected Sections of Code"> for a way to avoid tidying specific
 sections of code.
 
 =item B<-i=n>,  B<--indent-columns=n>
@@ -511,11 +498,15 @@ here-documents, they will remain.
 
 =item B<-et=n>,   B<--entab-leading-whitespace>
 
-This flag causes each B<n> initial space characters to be replaced by
-one tab character.
+This flag causes each B<n> leading space characters produced by the
+formatting process to be replaced by one tab character.  The
+formatting process itself works with space characters. The B<-et=n> parameter is applied
+as a last step, after formatting is complete, to convert leading spaces into tabs.
+Before starting to use tabs, it is essential to first get the indentation
+controls set as desired without tabs, particularly the two parameters B<--indent-columns=n> (or B<-i=n>) and B<--continuation-indentation=n> (or B<-ci=n>).
 
 The value of the integer B<n> can be any value but can be coordinated with the
-number of spaces used for intentation. For example, B<-et=4 -ci=4 -i=4> will
+number of spaces used for indentation. For example, B<-et=4 -ci=4 -i=4> will
 produce one tab for each indentation level and and one for each continuation
 indentation level.  You may want to coordinate the value of B<n> with what your
 display software assumes for the spacing of a tab.
@@ -527,7 +518,8 @@ of indentation.  Certain other features are incompatible with this
 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 B<-lp>
 option. This flag is retained for backwards compatibility, but
-if you use tabs, the B<-et=n> flag is recommended.
+if you use tabs, the B<-et=n> flag is recommended.  If both B<-t> and
+B<-et=n> are set, the B<-et=n> is used.
 
 =item B<-dt=n>,   B<--default-tabsize=n>
 
@@ -544,29 +536,6 @@ unstable editing).
 
 =back
 
-=item B<-xs>,   B<--extended-syntax>
-
-A problem with formatting Perl code is that some modules can introduce new
-syntax.  This flag allows perltidy to handle certain common extensions
-to the standard syntax without complaint.
-
-For example, without this flag a structure such as the following would generate
-a syntax error and the braces would not be balanced:
-
-    method deposit( Num $amount) {
-        $self->balance( $self->balance + $amount );
-    }
-
-For one of the extensions, module Switch::Plain, colons are marked as labels.
-If you use this module, you may want to also use the B<--nooutdent-labels> flag
-to prevent lines such as 'default:' from being outdented.
-
-This flag is enabled by default but it can be deactivated with B<-nxs>.
-Probably the only reason to deactivate this flag is to generate more diagnostic
-messages when debugging a script.
-
-For another method of handling extended syntax see the section L<Skipping Selected Sections of Code>.
-
 =item B<-io>,   B<--indent-only>
 
 This flag is used to deactivate all whitespace and line break changes
@@ -599,7 +568,7 @@ this flag is in effect.
 =item B<-enc=s>,  B<--character-encoding=s>
 
 This flag indicates if the input data stream use a character encoding.
-Perltidy does not look for the encoding directives in the soure stream, such
+Perltidy does not look for the encoding directives in the source stream, such
 as B<use utf8>, and instead relies on this flag to determine the encoding.
 (Note that perltidy often works on snippets of code rather than complete files
 so it cannot rely on B<use utf8> directives).
@@ -647,21 +616,34 @@ post-processing to handle decoding and encoding.
 
 =item B<-eos=s>,   B<--encode-output-strings=s>
 
-This flag has been added to resolve an issue involving the interface between
+This flag was added to resolve an issue involving the interface between
 Perl::Tidy and calling programs, and in particular B<Code::TidyAll (tidyall)>.
-By default Perl::Tidy returns unencoded strings to the calling
-program, but some programs expect encoded strings. Setting this flag causes
-Perl::Tidy to return encoded output strings which it decoded.  For some
-background information see
-L<https://github.com/perltidy/perltidy/issues/83> and
-L<https://github.com/houseabsolute/perl-code-tidyall/issues/84>.
 
-If you only run the B<perltidy> binary this flag has no effect.
+If you only run the B<perltidy> binary this flag has no effect.  If you run a
+program which calls the Perl::Tidy module and receives a string in return, then
+the meaning of the flag is as follows:
+
+=over 4
+
+=item *
+
+The setting B<-eos> means Perl::Tidy should encode any string which it decodes.
+This is the default because it makes perltidy behave well as a filter,
+and is the correct setting for most programs.
+
+=item *
+
+The setting B<-neos> means that a string should remain decoded if it was
+decoded by Perl::Tidy.  This is only appropriate if the calling program will
+handle any needed encoding before outputting the string.
 
-If you use B<tidyall> with encoded files and encounter irregularities such as
-B<wide character> messages you should set this flag.
+=back
 
-Additional information can be found in the man pages for the B<Perl::Tidy> module.
+The default was changed from B<-neos> to B<-eos> in versions after 20220217.
+If this change causes a program to start running incorrectly on encoded files,
+an emergency fix might be to set B<-neos>.  Additional information can be found
+in the man pages for the B<Perl::Tidy> module and also in
+L<https://github.com/perltidy/perltidy/blob/master/docs/eos_flag.md>.
 
 =item B<-gcs>,  B<--use-unicode-gcstring>
 
@@ -816,7 +798,7 @@ 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
+For example, if the input script was written with -i=2 and the current perltidy
 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
@@ -863,7 +845,7 @@ closing paren, see the next section.
 These flags have no effect on code BLOCKS, such as if/then/else blocks,
 which always use whatever is specified with B<-i=n>.
 
-Some limitiations on these flags are:
+Some limitations on these flags are:
 
 =over 4
 
@@ -953,7 +935,7 @@ result, but the B<-lpil=s> flag is much easier to describe and use and is
 recommended.  The B<-lpxl=s> flag was the original implementation and is
 only retained for backwards compatibility.
 
-This list B<s> for these parametes is a string with space-separated items.
+This list B<s> for these parameters is a string with space-separated items.
 Each item consists of up to three pieces of information in this order: (1) an
 optional letter code (2) a required container type, and (3) an optional numeric
 code.
@@ -963,7 +945,7 @@ The only required piece of information is a container type, which is one of
 
   -lpil='('
 
-means use -lp formatting only on lists within parentheses, not lists in square-bracets or braces.
+means use -lp formatting only on lists within parentheses, not lists in square-brackets or braces.
 The same thing could alternatively be specified with
 
   -lpxl = '[ {'
@@ -975,7 +957,7 @@ letter which is used to limit the selection further depending on the type of
 token immediately before the paren.  The possible letters are currently 'k',
 'K', 'f', 'F', 'w', and 'W', with these meanings for matching whatever precedes an opening paren:
 
- 'k' matches if the previous nonblank token is a perl builtin keyword (such as 'if', 'while'),
+ 'k' matches if the previous nonblank token is a perl built-in keyword (such as 'if', 'while'),
  'K' matches if 'k' does not, meaning that the previous token is not a keyword.
  'f' matches if the previous token is a function other than a keyword.
  'F' matches if 'f' does not.
@@ -1153,7 +1135,7 @@ has been set to), if possible.  This is the default.  For example:
             fixit($i);
         }
 
-Use B<-nola> to not outdent labels.  To control line breaks after labels see L<bal=n, --break-after-labels=n>.
+Use B<-nola> to not outdent labels.  To control line breaks after labels see L<"-bal=n, --break-after-labels=n">.
 
 =item B<Outdenting Keywords>
 
@@ -1439,7 +1421,7 @@ But the following will give a syntax error:
   for my $severity ( reverse $SEVERITY_LOWEST +1 .. $SEVERITY_HIGHEST ) { ... }
 
 To avoid subtle parsing problems like this, it is best to avoid spacing a
-binary operator asymetrically with a space on the left but not on the right.
+binary operator asymmetrically with a space on the left but not on the right.
 
 =item B<Space between specific keywords and opening paren>
 
@@ -1492,7 +1474,7 @@ B<-sfp>  or B<--space-function-paren>
 
 You will probably also want to use the flag B<-skp> (previous item) too.
 
-The reason this is not recommended is that spacing a function paren can make a
+The parameter is not recommended because spacing a function paren can make a
 program vulnerable to parsing problems by Perl.  For example, the following
 two-line program will run as written but will have a syntax error if
 reformatted with -sfp:
@@ -1823,7 +1805,7 @@ where C<string> is a list of block types to be tagged with closing side
 comments.  By default, all code block types preceded by a keyword or
 label (such as C<if>, C<sub>, and so on) will be tagged.  The B<-cscl>
 command changes the default list to be any selected block types; see
-L<Specifying Block Types>.
+L<"Specifying Block Types">.
 For example, the following command
 requests that only C<sub>'s, labels, C<BEGIN>, and C<END> blocks be
 affected by any B<-csc> or B<-dcsc> operation:
@@ -2146,7 +2128,7 @@ but they can be helpful for working around occasional problems.
 Note that it may be possible to avoid the use of B<--format-skipping> for the
 specific case of a comma-separated list of values, as in the above example, by
 simply inserting a blank or comment somewhere between the opening and closing
-parens.  See the section L<Controlling List Formatting>.
+parens.  See the section L<"Controlling List Formatting">.
 
 The following sections describe the available controls for these options.  They
 should not normally be needed.
@@ -2225,26 +2207,48 @@ The default is equivalent to -cse='#>>V'.
 
 =head2 Line Break Control
 
-The parameters in this section control breaks after
+The parameters in this and the next sections control breaks after
 non-blank lines of code.  Blank lines are controlled
-separately by parameters in the section L<Blank Line
-Control>.
+separately by parameters in the section L<"Blank Line Control">.
 
 =over 4
 
+=item B<-dnl>,  B<--delete-old-newlines>
+
+By default, perltidy first deletes all old line break locations, and then it
+looks for good break points to match the desired line length.  Use B<-ndnl>
+or  B<--nodelete-old-newlines> to force perltidy to retain all old line break
+points.
+
+=item B<-anl>,  B<--add-newlines>
+
+By default, perltidy will add line breaks when necessary to create
+continuations of long lines and to improve the script appearance.  Use
+B<-nanl> or B<--noadd-newlines> to prevent any new line breaks.
+
+This flag does not prevent perltidy from eliminating existing line
+breaks; see B<--freeze-newlines> to completely prevent changes to line
+break points.
+
 =item B<-fnl>,  B<--freeze-newlines>
 
 If you do not want any changes to the line breaks within
 lines of code in your script, set
 B<-fnl>, and they will remain fixed, and the rest of the commands in
 this section and sections
-L<Controlling List Formatting>,
-L<Retaining or Ignoring Existing Line Breaks>.
+L<"Controlling List Formatting">,
+L<"Retaining or Ignoring Existing Line Breaks">.
 You may want to use B<-noll> with this.
 
 Note: If you also want to keep your blank lines exactly
 as they are, you can use the B<-fbl> flag which is described
-in the section L<Blank Line Control>.
+in the section L<"Blank Line Control">.
+
+=back
+
+=head2 Controlling Breaks at Braces, Parens, and Square Brackets
+
+=over 4
 
 =item B<-ce>,   B<--cuddled-else>
 
@@ -2339,13 +2343,13 @@ B<-ce>.
 When cuddled else formatting is selected with B<-ce>, setting this flag causes
 perltidy to ignore its built-in defaults and rely exclusively on the block types
 specified on the B<-cbl> flag described in the previous section.  For example,
-to avoid using cuddled B<catch> and B<finally>, which among in the defaults, the
+to avoid using cuddled B<catch> and B<finally>, which are among the defaults, the
 following set of parameters could be used:
 
   perltidy -ce -cbl='else elsif continue' -cblx
 
 
-=item B<-cbo=n>,   B<--cuddled-break-option=n>
+=item B<-cbo=n>, B<--cuddled-break-option=n>
 
 Cuddled formatting is only possible between a pair of code blocks if the
 closing brace of the first block starts a new line. If a block is encountered
@@ -2395,14 +2399,14 @@ parameters B<--brace-left-list> and B<-brace-left-exclusion-list> described in t
 =item B<-bll=s>, B<--brace-left-list=s>
 
 Use this parameter to change the types of block braces for which the
-B<-bl> flag applies; see L<Specifying Block Types>.  For example,
+B<-bl> flag applies; see L<"Specifying Block Types">.  For example,
 B<-bll='if elsif else sub'> would apply it to only C<if/elsif/else>
 and named sub blocks.  The default is all blocks, B<-bll='*'>.
 
 =item B<-blxl=s>, B<--brace-left-exclusion-list=s>
 
 Use this parameter to exclude types of block braces for which the
-B<-bl> flag applies; see L<Specifying Block Types>.  For example,
+B<-bl> flag applies; see L<"Specifying Block Types">.  For example,
 the default settings B<-bll='*'> and B<-blxl='sort map grep eval asub'>
 mean all blocks except B<sort map grep eval> and anonymous sub blocks.
 
@@ -2482,14 +2486,14 @@ a certain block type, the B<-bli> style has priority.
 =item B<-blil=s>,    B<--brace-left-and-indent-list=s>
 
 Use this parameter to change the types of block braces for which the
-B<-bli> flag applies; see L<Specifying Block Types>.
+B<-bli> flag applies; see L<"Specifying Block Types">.
 
 The default is B<-blil='if else elsif unless while for foreach do : sub'>.
 
 =item B<-blixl=s>, B<--brace-left-and-indent-exclusion-list=s>
 
 Use this parameter to exclude types of block braces for which the B<-bli> flag
-applies; see L<Specifying Block Types>.
+applies; see L<"Specifying Block Types">.
 
 This might be useful in conjunction with selecting all blocks B<-blil='*'>.
 The default setting is B<-blixl=' '>, which does not exclude any blocks.
@@ -2681,6 +2685,12 @@ which is placed on a new line by that parameter.  The indentation is as follows:
   -bbpi=1 outdent by one continuation level
   -bbpi=2 indent one full indentation level
 
+=back
+
+=head2 Welding
+
+=over 4
+
 =item B<-wn>,  B<--weld-nested-containers>
 
 The B<-wn> flag causes closely nested pairs of opening and closing container
@@ -2710,7 +2720,8 @@ must either (1) be adjacent as in the above example, or (2) have an anonymous
 sub declaration following an outer opening container symbol which is not a
 code block brace, or (3) have an outer opening paren separated from the inner
 opening symbol by any single non-container symbol or something that looks like
-a function evaluation, as illustrated in the next examples.
+a function evaluation, as illustrated in the next examples. An additional
+option (4) which can be turned on with the flag B<--weld-fat-comma> is when the opening container symbols are separated by a hash key and fat comma (=>).
 
 Any container symbol may serve as both the inner container of one pair and as
 the outer container of an adjacent pair. Consequently, any number of adjacent
@@ -2789,6 +2800,19 @@ specially in perltidy.
 Finally, the stacking of containers defined by this flag have priority over
 any other container stacking flags.  This is because any welding is done first.
 
+=item B<-wfc>,  B<--weld-fat-comma >
+
+When the B<-wfc> flag is set, along with B<-wn>, perltidy is allowed to weld
+an opening paren to an inner opening container when they are separated by a hash key and fat comma (=>). for example
+
+    # perltidy -wn -wfc
+    elf->call_method( method_name_foo => {
+        some_arg1       => $foo,
+        some_other_arg3 => $bar->{'baz'},
+    } );
+
+This option is off by default.
+
 =item B<-wnxl=s>,  B<--weld-nested-exclusion-list>
 
 The B<-wnxl=s> flag provides some control over the types of containers which
@@ -2811,7 +2835,7 @@ last represents a quoted list.  For example the string
 
   -wnxl='[ { q'
 
-means do B<NOT> include square-bracets, braces, or quotes in any welds.  The only unspecified
+means do B<NOT> include square-brackets, braces, or quotes in any welds.  The only unspecified
 container is '(', so this string means that only welds involving parens will be made.
 
 To illustrate, following welded snippet consists of a chain of three welded
@@ -2848,7 +2872,7 @@ token immediately before the container.  If given, it goes just before the
 container symbol.  The possible letters are currently 'k', 'K', 'f', 'F',
 'w', and 'W', with these meanings:
 
- 'k' matches if the previous nonblank token is a perl builtin keyword (such as 'if', 'while'),
+ 'k' matches if the previous nonblank token is a perl built-in keyword (such as 'if', 'while'),
  'K' matches if 'k' does not, meaning that the previous token is not a keyword.
  'f' matches if the previous token is a function other than a keyword.
  'F' matches if 'f' does not.
@@ -2885,6 +2909,7 @@ Here are some additional example strings and their meanings:
     '[ {'  - exclude all brackets and braces
     '[ ( ^K{' - exclude everything except nested structures like do {{  ... }}
 
+
 =item B<Vertical tightness> of non-block curly braces, parentheses, and square brackets.
 
 These parameters control what shall be called vertical tightness.  Here are the
@@ -3075,7 +3100,7 @@ B<until>, and also with a preceding label.  This can be changed with
 the parameter B<-bbvtl=string>, or
 B<--block-brace-vertical-tightness-list=string>, where B<string> is a
 space-separated list of block types.  For more information on the
-possible values of this string, see L<Specifying Block Types>
+possible values of this string, see L<"Specifying Block Types">
 
 For example, if we want to just apply this style to C<if>,
 C<elsif>, and C<else> blocks, we could use
@@ -3196,24 +3221,9 @@ unnecessary indentation within welded containers.  It is able to do this
 because it works on formatting globally rather than locally, as the B<-sot> and
 B<-sct> flags do.
 
-=item B<-dnl>,  B<--delete-old-newlines>
-
-By default, perltidy first deletes all old line break locations, and then it
-looks for good break points to match the desired line length.  Use B<-ndnl>
-or  B<--nodelete-old-newlines> to force perltidy to retain all old line break
-points.
-
-=item B<-anl>,  B<--add-newlines>
-
-By default, perltidy will add line breaks when necessary to create
-continuations of long lines and to improve the script appearance.  Use
-B<-nanl> or B<--noadd-newlines> to prevent any new line breaks.
-
-This flag does not prevent perltidy from eliminating existing line
-breaks; see B<--freeze-newlines> to completely prevent changes to line
-break points.
+=back
 
-=item B<Controlling whether perltidy breaks before or after operators>
+=head2 Breaking Before or After Operators
 
 Four command line parameters provide some control over whether
 a line break should be before or after specific token types.
@@ -3275,12 +3285,14 @@ with the B<-wba> and B<-wbb> flags.  For example, to break before all operators
 except an B<=> one could use --bbao -wba='=' rather than listing every
 single perl operator except B<=> on a -wbb flag.
 
-=item B<bal=n, --break-after-labels=n>
+=over 4
+
+=item B<-bal=n, --break-after-labels=n>
 
 This flag controls whether or not a line break occurs after a label. There
-are three possible valuse for B<n>:
+are three possible values for B<n>:
 
-  -bal=0  break if there is a break in the input [DEFAULt]
+  -bal=0  break if there is a break in the input [DEFAULT]
   -bal=1  always break after a label
   -bal=2  never break after a label
 
@@ -3340,7 +3352,7 @@ anywhere between the opening and closing parens.  Vertical alignment
 of the list items will still occur if possible.
 
 For another possibility see
-the -fs flag in L<Skipping Selected Sections of Code>.
+the -fs flag in L<"Skipping Selected Sections of Code">.
 
 =over 4
 
@@ -3362,14 +3374,12 @@ tables in the file must already be nicely formatted.
 
 =item B<-mft=n>,  B<--maximum-fields-per-table=n>
 
-If the computed number of fields for any table exceeds B<n>, then it
-will be reduced to B<n>.  The default value for B<n> is a large number,
-40.  While this value should probably be left unchanged as a general
-rule, it might be used on a small section of code to force a list to
-have a particular number of fields per line, and then either the B<-boc>
-flag could be used to retain this formatting, or a single comment could
-be introduced somewhere to freeze the formatting in future applications
-of perltidy.
+If B<n> is a positive number, and the computed number of fields for any table
+exceeds B<n>, then it will be reduced to B<n>.  This parameter might be used on
+a small section of code to force a list to have a particular number of fields
+per line, and then either the B<-boc> flag could be used to retain this
+formatting, or a single comment could be introduced somewhere to freeze the
+formatting in future applications of perltidy. For example
 
     # perltidy -mft=2
     @month_of_year = (
@@ -3381,6 +3391,9 @@ of perltidy.
         'Nov', 'Dec'
     );
 
+The default value is B<n=0>, which does not place a limit on the
+number of fields in a table.
+
 =item B<-cab=n>,  B<--comma-arrow-breakpoints=n>
 
 A comma which follows a comma arrow, '=>', is given special
@@ -3434,6 +3447,216 @@ Here is an example.
 
 =back
 
+=head2 Adding and Deleting Commas
+
+=over 4
+
+=item B<-drc>,  B<--delete-repeated-commas>
+
+Repeated commas in a list are undesirable and can be removed with this flag.
+For example, given this list with a repeated comma
+
+      ignoreSpec( $file, "file",, \%spec, \%Rspec );
+
+we can remove it with -drc
+
+      # perltidy -drc:
+      ignoreSpec( $file, "file", \%spec, \%Rspec );
+
+Since the default is not to add or delete commas, this feature is off by default and must be requested.
+
+
+=item B<--want-trailing-commas=s> or B<-wtc=s>, B<--add-trailing-commas> or B<-atc>, and B<--delete-trailing-commas> or B<-dtc>
+
+A trailing comma is a comma following the last item of a list. Perl allows
+trailing commas but they are not required.  By default, perltidy does not add
+or delete trailing commas, but it is possible to manipulate them with the
+following set of three related parameters:
+
+  --want-trailing-commas=s, -wtc=s - defines where trailing commas are wanted
+  --add-trailing-commas,    -atc   - gives permission to add trailing commas to match the style wanted
+  --delete-trailing-commas, -dtc   - gives permission to delete trailing commas which do not match the style wanted
+
+The parameter B<--want-trailing-commas=s>, or B<-wtc=s>, defines a preferred style.  The string B<s> indicates which lists should get trailing commas, as follows:
+
+  s=0 : no list should have a trailing comma
+  s=1 or * : every list should have a trailing comma
+  s=m a multi-line list should have a trailing commas
+  s=b trailing commas should be 'bare' (comma followed by newline)
+  s=h lists of key=>value pairs, with about one one '=>' and one ',' per line,
+      with a bare trailing comma
+  s=i lists with about one comma per line, with a bare trailing comma
+  s=' ' or -wtc not defined : leave trailing commas unchanged [DEFAULT].
+
+This parameter by itself only indicates the where trailing commas are
+wanted.  Perltidy only adds these trailing commas if the flag B<--add-trailing-commas>, or B<-atc> is set.  And perltidy only removes unwanted trailing commas
+if the flag B<--delete-trailing-commas>, or B<-dtc> is set.
+
+Here are some example parameter combinations and their meanings
+
+  -wtc=0 -dtc   : delete all trailing commas
+  -wtc=1 -atc   : all lists get trailing commas
+  -wtc=m -atc   : all multi-line lists get trailing commas, but
+                  single line lists remain unchanged.
+  -wtc=m -dtc   : multi-line lists remain unchanged, but
+                  any trailing commas on single line lists are removed.
+  -wtc=m -atc -dtc  : all multi-line lists get trailing commas, and
+                      any trailing commas on single line lists are removed.
+
+For example, given the following input without a trailing comma
+
+    bless {
+        B    => $B,
+        Root => $Root
+    } => $package;
+
+we can add a trailing comma after the variable C<$Root> using
+
+    # perltidy -wtc=m -atc
+    bless {
+        B    => $B,
+        Root => $Root,
+    } => $package;
+
+This could also be achieved in this case with B<-wtc=b> instead of B<-wtc=m>
+because the trailing comma here is bare (separated from its closing brace by a
+newline).  And it could also be achieved with B<-wtc=h> because this particular
+list is a list of key=>value pairs.
+
+The above styles should cover the main of situations of interest, but it is
+possible to apply a different style to each type of container token by
+including an opening token ahead of the style character in the above table.
+For example
+
+    -wtc='(m [b'
+
+means that lists within parens should have multi-line trailing commas, and that
+lists within square brackets have bare trailing commas. Since there is no
+specification for curly braces in this example, their trailing commas would
+remain unchanged.
+
+For parentheses, an additional item of information which can be given is an
+alphanumeric letter which is used to limit the selection further depending on
+the type of token immediately before the opening paren.  The possible letters
+are currently 'k', 'K', 'f', 'F', 'w', and 'W', with these meanings for
+matching whatever precedes an opening paren:
+
+ 'k' matches if the previous nonblank token is a perl built-in keyword (such as 'if', 'while'),
+ 'K' matches if 'k' does not, meaning that the previous token is not a keyword.
+ 'f' matches if the previous token is a function other than a keyword.
+ 'F' matches if 'f' does not.
+ 'w' matches if either 'k' or 'f' match.
+ 'W' matches if 'w' does not.
+
+These are the same codes used for B<--line-up-parentheses-inclusion-list>.
+For example,
+
+  -wtc = 'w(m'
+
+means that trailing commas are wanted for multi-line parenthesized lists following a function call or keyword.
+
+Here are some points to note regarding adding and deleting trailing commas:
+
+=over 4
+
+=item *
+
+For the implementation of these parameters, a B<list> is basically taken to be
+a container of items (parens, square brackets, or braces), which is not a code
+block, with one or more commas.  These parameters only apply to something that
+fits this definition of a list.
+
+Note that a paren-less list of parameters is not a list by this definition, so
+these parameters have no effect on a peren-less list.
+
+Another consequence is that if the only comma in a list is deleted, then it
+cannot later be added back with these parameters because the container no
+longer fits this definition of a list.  For example, given
+
+    my ( $self, ) = @_;
+
+and if we remove the comma with
+
+    # perltidy -wtc=m -dtc
+    my ( $self ) = @_;
+
+then we cannot use these trailing comma controls to add this comma back.
+
+=item *
+
+By B<multiline> list is meant a list for which the first comma and trailing comma
+are on different lines.
+
+=item *
+
+A B<bare> trailing comma is a comma which is at the end of a line. That is,
+the closing container token follows on a different line.  So a list with a
+bare trailing comma is a special case of a multi-line list.
+
+=item *
+
+The decision regarding whether or not a list is multi-line or bare is
+made based on the B<input> stream.  In some cases it may take an iteration
+or two to reach a final state.
+
+=item *
+
+When using these parameters for the first time it is a good idea to practice
+on some test scripts and verify that the results are as expected.
+
+=item *
+
+Since the default behavior is not to add or delete commas, these parameters
+can be useful on a temporary basis for reformatting a script.
+
+=back
+
+=item B<-dwic>,  B<--delete-weld-interfering-commas>
+
+If the closing tokens of two nested containers are separated by a comma, then
+welding requested with B<--weld-nested-containers> cannot occur.  Any commas in
+this situation are optional trailing commas and can be removed with B<-dwic>.
+For example, a comma in this script prevents welding:
+
+    # perltidy -wn
+    skip_symbols(
+        [ qw(
+            Perl_dump_fds
+            Perl_ErrorNo
+            Perl_GetVars
+            PL_sys_intern
+        ) ],
+    );
+
+Using B<-dwic> removes the comma and allows welding:
+
+    # perltidy -wn -dwic
+    skip_symbols( [ qw(
+        Perl_dump_fds
+        Perl_ErrorNo
+        Perl_GetVars
+        PL_sys_intern
+    ) ] );
+
+Since the default is not to add or delete commas, this feature is off by default.
+Here are some points to note about the B<-dwic> parameter
+
+=over 4
+
+=item *
+
+This operation is not reversible, so please check results of using this parameter carefully.
+
+=item *
+
+Removing this type of isolated trailing comma is necessary for welding to be
+possible, but not sufficient.  So welding will not always occur where these
+commas are removed.
+
+=back
+
+=back
+
 =head2 Retaining or Ignoring Existing Line Breaks
 
 Several additional parameters are available for controlling the extent
@@ -3483,7 +3706,7 @@ For example, given this snippet:
 By default, a method call arrow C<-E<gt>> is considered a candidate for
 a breakpoint, but method chains will fill to the line width before a break is
 considered.  With B<-bom>, breaks before the arrow are preserved, so if you
-have preformatted a method chain:
+have pre-formatted a method chain:
 
   my $q = $rs
     ->related_resultset('CDs')
@@ -3616,7 +3839,7 @@ these meanings (these are the same as used in the
 B<--weld-nested-exclusion-list> and B<--line-up-parentheses-exclusion-list>
 parameters):
 
- 'k' matches if the previous nonblank token is a perl builtin keyword (such as 'if', 'while'),
+ 'k' matches if the previous nonblank token is a perl built-in keyword (such as 'if', 'while'),
  'K' matches if 'k' does not, meaning that the previous token is not a keyword.
  'f' matches if the previous token is a function other than a keyword.
  'F' matches if 'f' does not.
@@ -3628,12 +3851,10 @@ parens:
 
    perltidy -kba='f('
 
-B<NOTE>: To match all opening curly braces, and no other opening tokens, please
-prefix the brace it with an asterisk, like this: '*{'.  Otherwise a warning
-message will occur. This is necessary to avoid problems while the input scheme
-is being updated and generalized.  A single bare curly brace previously matched
-all container tokens, and tentatively still does. Likewise, to match all
-closing curly braces, and no other closing tokens, use '*}'.
+B<NOTE>: A request to break before an opening container, such as B<-kbb='('>,
+will be silently ignored because it can lead to formatting instability.
+Likewise, a request to break after a closing container, such as B<-kba>=')',
+will also be silently ignored.
 
 =item B<-iob>,  B<--ignore-old-breakpoints>
 
@@ -4009,7 +4230,7 @@ B<use> and B<my> statements.
 B<-kgbd> or B<--keyword-group-blanks-delete> controls the deletion of any
 blank lines that exist in the the group when it is first scanned.  When
 statements are initially scanned, any existing blank lines are included in the
-collection.  Any such orignial blank lines will be deleted before any other
+collection.  Any such original blank lines will be deleted before any other
 insertions are made when the parameter B<-kgbd> is set.  The default is not to
 do this, B<-nkgbd>.
 
@@ -4109,9 +4330,9 @@ B<-nst> and/or B<-nse> after the -pbp parameter.
 
 Also note that the value of continuation indentation, -ci=4, is equal to the
 value of the full indentation, -i=4.  It is recommended that the either (1) the
-parameter B<-ci=2> be used instead, or the flag B<-xci> be set.  This will help
-show structure, particularly when there are ternary statements. The following
-snippet illustrates these options.
+parameter B<-ci=2> be used instead, or (2) the flag B<-xci> be set.  This will
+help show structure, particularly when there are ternary statements. The
+following snippet illustrates these options.
 
     # perltidy -pbp
     $self->{_text} = (
@@ -4151,66 +4372,72 @@ snippet illustrates these options.
 The B<-xci> flag was developed after the B<-pbp> parameters were published so you need
 to include it separately.
 
-=item B<One-line blocks>
+=back
+
+=head2 One-Line Blocks
 
-There are a few points to note regarding one-line blocks.  A one-line
-block is something like this,
+A one-line block is a block of code where the contents within the curly braces
+is short enough to fit on a single line. For example,
 
     if ( -e $file ) { print "'$file' exists\n" }
 
-where the contents within the curly braces is short enough to fit
-on a single line.
+The alternative, a block which spans multiple lines, is said to be a broken
+block.  With few exceptions, perltidy retains existing one-line blocks, if it
+is possible within the line-length constraint, but it does not attempt to form
+new ones.  In other words, perltidy will try to follow the input file regarding
+broken and unbroken blocks.
 
-With few exceptions, perltidy retains existing one-line blocks, if it
-is possible within the line-length constraint, but it does not attempt
-to form new ones.  In other words, perltidy will try to follow the
-one-line block style of the input file.
+The main exception to this rule is that perltidy will attempt to form new
+one-line blocks following the keywords C<map>, C<eval>, and C<sort>, C<eval>,
+because these code blocks are often small and most clearly displayed in a
+single line. This behavior can be controlled with the flag
+B<--one-line-block-exclusion-list> described below.
 
-If an existing one-line block is longer than the maximum line length,
-however, it will be broken into multiple lines.  When this happens, perltidy
-checks for and adds any optional terminating semicolon (unless the B<-nasc>
-option is used) if the block is a code block.
+When the B<cuddled-else> style is used, the default treatment of one-line blocks
+may interfere with the cuddled style.  In this case, the default behavior may 
+be changed with the flag B<--cuddled-break-option=n> described elsehwere.
 
-The main exception is that perltidy will attempt to form new one-line
-blocks following the keywords C<map>, C<eval>, and C<sort>, because
-these code blocks are often small and most clearly displayed in a single
-line.
+When an existing one-line block is longer than the maximum line length, and
+must therefore be broken into multiple lines, perltidy checks for and adds any
+optional terminating semicolon (unless the B<-nasc> option is used) if the
+block is a code block.
 
-One-line block rules can conflict with the cuddled-else option.  When
-the cuddled-else option is used, perltidy retains existing one-line
-blocks, even if they do not obey cuddled-else formatting.
+=over 4
 
-Occasionally, when one-line blocks get broken because they exceed the
-available line length, the formatting will violate the requested brace style.
-If this happens, reformatting the script a second time should correct
-the problem.
+=item B<-olbxl=s>, B<--one-line-block-exclusion-list=s>
 
-Sometimes it might be desirable to convert a script to have one-line blocks
-whenever possible.  Although there is currently no flag for this, a simple
-workaround is to execute perltidy twice, once with the flag B<-noadd-newlines>
-and then once again with normal parameters, like this:
+As noted above, perltidy will, by default, attempt to create new one-line
+blocks for certain block types.  This flag allows the user to prevent this behavior for the block types listed in the string B<s>.  The list B<s> may
+include any of the words C<sort>, C<map>, C<grep>, C<eval>,  or it may be C<*>
+to indicate all of these.
 
-     cat infile | perltidy -nanl | perltidy >outfile
+So for example to prevent multi-line B<eval> blocks from becoming one-line
+blocks, the command would be B<-olbxl='eval'>.  In this case, existing one-line B<eval> blocks will remain on one-line if possible, and existing multi-line
+B<eval> blocks will remain multi-line blocks.
 
-When executed on this snippet
+=item B<-olbn=n>, B<--one-line-block-nesting=n>
 
-    if ( $? == -1 ) {
-        die "failed to execute: $!\n";
-    }
-    if ( $? == -1 ) {
-        print "Had enough.\n";
-        die "failed to execute: $!\n";
-    }
+Nested one-line blocks are lines with code blocks which themselves contain code
+blocks.  For example, the following line is a nested one-line block.
 
-the result is
+         foreach (@list) { if ($_ eq $asked_for) { last } ++$found }
 
-    if ( $? == -1 ) { die "failed to execute: $!\n"; }
-    if ( $? == -1 ) {
-        print "Had enough.\n";
-        die "failed to execute: $!\n";
+The default behavior is to break such lines into multiple lines, but this
+behavior can be controlled with this flag.  The values of n are:
+
+  n=0 break nested one-line blocks into multiple lines [DEFAULT]
+  n=1 stable: keep existing nested-one line blocks intact
+
+For the above example, the default formatting (B<-olbn=0>) is
+
+    foreach (@list) {
+        if ( $_ eq $asked_for ) { last }
+        ++$found;
     }
 
-This shows that blocks with a single statement become one-line blocks.
+If the parameter B<-olbn=1> is given, then the line will be left intact if it
+is a single line in the source, or it will be broken into multiple lines if it
+is broken in multiple lines in the source.
 
 =item B<-olbs=n>, B<--one-line-block-semicolons=n>
 
@@ -4230,33 +4457,49 @@ all one-line blocks, regardless of complexity, the B<n=0> option only removes
 ending semicolons which terminate one-line blocks containing just one
 semicolon.  So these two options are not exact inverses.
 
-=item B<-olbn=n>, B<--one-line-block-nesting=n>
+=item B<Forming new one-line blocks>
 
-Nested one-line blocks are lines with code blocks which themselves contain code
-blocks.  For example, the following line is a nested one-line block.
+Sometimes it might be desirable to convert a script to have one-line blocks
+whenever possible.  Although there is currently no flag for this, a simple
+workaround is to execute perltidy twice, once with the flag B<-noadd-newlines>
+and then once again with normal parameters, like this:
 
-         foreach (@list) { if ($_ eq $asked_for) { last } ++$found }
+     cat infile | perltidy -nanl | perltidy >outfile
 
-The default behavior is to break such lines into multiple lines, but this
-behavior can be controlled with this flag.  The values of n are:
+When executed on this snippet
 
-  n=0 break nested one-line blocks into multiple lines [DEFAULT]
-  n=1 stable: keep existing nested-one line blocks intact
+    if ( $? == -1 ) {
+        die "failed to execute: $!\n";
+    }
+    if ( $? == -1 ) {
+        print "Had enough.\n";
+        die "failed to execute: $!\n";
+    }
 
-For the above example, the default formatting (B<-olbn=0>) is
+the result is
 
-    foreach (@list) {
-        if ( $_ eq $asked_for ) { last }
-        ++$found;
+    if ( $? == -1 ) { die "failed to execute: $!\n"; }
+    if ( $? == -1 ) {
+        print "Had enough.\n";
+        die "failed to execute: $!\n";
     }
 
-If the parameter B<-olbn=1> is given, then the line will be left intact if it
-is a single line in the source, or it will be broken into multiple lines if it
-is broken in multiple lines in the source.
+This shows that blocks with a single statement become one-line blocks.
 
+=item B<Breaking existing one-line blocks>
 
-=back
+There is no automatic way to break existing long one-line blocks into multiple
+lines, but this can be accomplished by processing a script, or section of a
+script, with a short value of the parameter B<maximum-line-length=n>.  Then,
+when the script is reformatted again with the normal parameters, the blocks
+which were broken will remain broken (with the exceptions noted above).
 
+Another trick for doing this for certain block types is to format one time with
+the B<-cuddled-else> flag and B<--cuddled-break-option=2>. Then format again
+with the normal parameters.  This will break any one-line blocks which are
+involved in a cuddled-else style.
+
+=back
 
 =head2 Controlling Vertical Alignment
 
@@ -4306,7 +4549,7 @@ For example,
 
 =item B<Completely turning off vertical alignment with -novalign>
 
-The default is to use vertical alignment, but bertical alignment can be
+The default is to use vertical alignment, but vertical alignment can be
 completely turned of with the B<-novalign> flag.
 
 A lower level of control of vertical alignment is possible with three parameters
@@ -4326,7 +4569,7 @@ below.
 =item B<Controlling side comment alignment with --valign-side-comments or -vsc>
 
 The B<-vsc> flag enables alignment of side comments and is enabled by default.  If side
-comment aligment is disabled with B<-nvsc> they will appear at a fixed space from the
+comment alignment is disabled with B<-nvsc> they will appear at a fixed space from the
 preceding code token.  The default is B<-vsc>
 
 =item B<Controlling block comment alignment with --valign-block-comments or -vbc>
@@ -4344,17 +4587,21 @@ parameters.  Most of the vertical alignments in typical programs occur at one
 of the tokens ',', '=', and '=>', but many other alignments are possible and are given in the following list:
 
   = **= += *= &= <<= &&= -= /= |= >>= ||= //= .= %= ^= x=
-  { ( ? : , ; => && || ~~ !~~ =~ !~ // <=> ->
+  { ( ? : , ; => && || ~~ !~~ =~ !~ // <=> -> q
   if unless and or err for foreach while until
 
-These alignments are all enabled by default, but they can be selectively disabled by including one or more of these tokens in the space-separated list B<valign-exclusion-list=s>.
+These alignment types correspond to perl symbols, operators and keywords except
+for 'q', which refers to the special case of alignment in a 'use' statement of
+qw quotes and empty parens. 
+
+They are all enabled by default, but they can be selectively disabled by including one or more of these tokens in the space-separated list B<valign-exclusion-list=s>.
 For example, the following would prevent alignment at B<=> and B<if>:
 
   --valign-exclusion-list='= if'
 
 If it is simpler to specify only the token types which are to be aligned, then
 include the types which are to be aligned in the list of B<--valign-inclusion-list>.
-You may leave the B<valign-exclusion-list> undefined, or use the special symbol B<*> for the exclusion list.
+In that case you may leave the B<valign-exclusion-list> undefined, or use the special symbol B<*> for the exclusion list.
 For example, the following parameters enable alignment only at commas and 'fat commas':
 
   --valign-inclusion-list=', =>'
@@ -4401,6 +4648,82 @@ controlled separately with the parameter B<--valign-side_comments> described abo
 
 =back
 
+=head2 Extended Syntax
+
+This section describes some parameters for dealing with extended syntax.
+
+For another method of handling extended syntax see the section L<"Skipping Selected Sections of Code">.
+
+Also note that the module F<Perl::Tidy> supplies a pre-filter and post-filter capability. This requires calling the module from a separate program rather than through the binary F<perltidy>. 
+
+=over 4
+
+=item B<-xs>,   B<--extended-syntax>
+
+This flag allows perltidy to handle certain common extensions
+to the standard syntax without complaint.
+
+For example, without this flag a structure such as the following would generate
+a syntax error:
+
+    Method deposit( Num $amount) {
+        $self->balance( $self->balance + $amount );
+    }
+
+This flag is enabled by default but it can be deactivated with B<-nxs>.
+Probably the only reason to deactivate this flag is to generate more diagnostic
+messages when debugging a script.
+
+=item B<-sal=s>,   B<--sub-alias-list=s>
+
+This flag causes one or more words to be treated the same as if they were the keyword B<sub>.  The string B<s> contains one or more alias words, separated by spaces or commas.
+
+For example,
+
+        perltidy -sal='method fun _sub M4'
+
+will cause the perltidy to treat the words 'method', 'fun', '_sub' and 'M4' the same as if they were 'sub'.  Note that if the alias words are separated by spaces then the string of words should be placed in quotes.
+
+Note that several other parameters accept a list of keywords, including 'sub' (see L<"Specifying Block Types">).
+You do not need to include any sub aliases in these lists. Just include keyword 'sub' if you wish, and all aliases are automatically included.
+
+=item B<-gal=s>,   B<--grep-alias-list=s>
+
+This flag allows a code block following an external 'list operator' function to be formatted as if it followed one of the built-in keywords B<grep>,  B<map> or B<sort>.  The string B<s> contains the names of one or more such list operators, separated by spaces or commas.
+
+By 'list operator' is meant a function which is invoked in the form
+
+      word {BLOCK} @list
+
+Perltidy tries to keep code blocks for these functions intact, since they are usually short, and does not automatically break after the closing brace since a list may follow. It also does some special handling of continuation indentation.
+
+For example, the code block arguments to functions 'My_grep' and 'My_map' can be given formatting like 'grep' with
+
+        perltidy -gal='My_grep My_map'
+
+By default, the following list operators in List::Util are automatically included:
+
+      all any first none notall reduce reductions
+
+Any operators specified with B<--grep-alias-list> are added to this list.
+The next parameter can be used to remove words from this default list.
+
+=item B<-gaxl=s>,   B<--grep-alias-exclusion-list=s>
+
+The B<-gaxl=s> flag provides a method for removing any of the default list operators given above
+by listing them in the string B<s>.  To remove all of the default operators use B<-gaxl='*'>.
+
+=item B<-uf=s>,   B<--use-feature=s>
+
+This flag tells perltidy to allow the syntax associated a pragma in string
+B<s>. Currently only the recognized values for the string are B<s='class'> or
+string B<s=' '>.  The default is B<--use-feature='class'>.  This enables
+perltidy to recognized the special words B<class>, B<method>, B<field>, and
+B<ADJUST>.  If this causes a conflict with other uses of these words, the
+default can be turned off with B<--use-feature=' '>.
+
+=back
+
 =head2 Other Controls
 
 =over 4
@@ -4419,6 +4742,10 @@ Two commands which remove comments (but not pod) are: B<-dbc> or
 B<--delete-block-comments> and B<-dsc> or  B<--delete-side-comments>.
 (Hanging side comments will be deleted with side comments here.)
 
+When side comments are deleted, any special control side comments for
+non-indenting braces will be retained unless they are deactivated with
+a B<-nnib> flag.
+
 The negatives of these commands also work, and are the defaults.  When
 block comments are deleted, any leading 'hash-bang' will be retained.
 Also, if the B<-x> flag is used, any system commands before a leading
@@ -4459,7 +4786,7 @@ F</etc/perltidyrc>.  Note that these last two system-wide files do not
 have a leading dot.  Further system-dependent information will be found
 in the INSTALL file distributed with perltidy.
 
-Under Windows, perltidy will also search for a configuration file named perltidy.ini since Windows does not allow files with a leading period (.).
+Under Windows, perltidy will also search for a configuration file named F<perltidy.ini> since Windows does not allow files with a leading period (.).
 Use C<perltidy -dpro> to see the possible locations for your system.
 An example might be F<C:\Documents and Settings\All Users\perltidy.ini>.
 
@@ -4707,6 +5034,97 @@ to avoid causing problems with scripts which have extended syntaxes.
 B<-DEBUG>  will write a file with extension F<.DEBUG> for each input file
 showing the tokenization of all lines of code.
 
+=item B<Making a table of information on code blocks>
+
+A table listing information about the blocks of code in a file can be made with
+B<--dump-block-summary>, or B<-dbs>.  This causes perltidy to read and parse
+the file, write a table of comma-separated values for selected code blocks to
+the standard output, and then exit.  This parameter must be on the command
+line, not in a F<.perlticyrc> file, and it requires a single file name on the
+command line.  For example
+
+   perltidy -dbs somefile.pl >blocks.csv
+
+produces an output file F<blocks.csv> whose lines hold these
+parameters:
+
+    filename     - the name of the file
+    line         - the line number of the opening brace of this block
+    line_count   - the number of lines between opening and closing braces
+    code_lines   - the number of lines excluding blanks, comments, and pod
+    type         - the block type (sub, for, foreach, ...)
+    name         - the block name if applicable (sub name, label, asub name)
+    depth        - the nesting depth of the opening block brace
+    max_change   - the change in depth to the most deeply nested code block
+    block_count  - the total number of code blocks nested in this block
+    mccabe_count - the McCabe complexity measure of this code block
+
+This feature was developed to help identify complex sections of code as an aid
+in refactoring.  The McCabe complexity measure follows the definition used by
+Perl::Critic.  By default the table contains these values for subroutines, but
+the user may request them for any or all blocks of code or packages.  For
+blocks which are loops nested within loops, a postfix '+' to the C<type> is
+added to indicate possible code complexity.  Although the table does not
+otherwise indicate which blocks are nested in other blocks, this can be
+determined by computing and comparing the block ending line numbers.
+
+By default the table lists subroutines with more than 20 C<code_lines>, but
+this can be changed with the following two parameters:
+
+B<--dump-block-minimum-lines=n>, or B<-dbl=n>, where B<n> is the minimum
+number of C<code_lines> to be included. The default is B<-n=20>.  Note that
+C<code_lines> is the number of lines excluding and comments, blanks and pod.
+
+B<--dump-block-types=s>, or B<-dbt=s>, where string B<s> is a list of block
+types to be included.  The type of a block is either the name of the perl
+builtin keyword for that block (such as B<sub if elsif else for foreach ..>) or
+the word immediately before the opening brace.  In addition, there are
+a few symbols for special block types, as follows:
+
+   if elsif else for foreach ... any keyword introducing a block
+   sub  - any sub or anynomous sub
+   asub - any anonymous sub
+   *    - any block except nameless blocks
+   +    - any nested inner block loop
+   package - any package or class
+   closure - any nameless block
+
+In addition, specific block loop types which are nested in other loops can be
+selected by adding a B<+> after the block name. (Nested loops are sometimes
+good candidates for restructuring).
+
+The default is B<-dbt='sub'>.
+
+In the following examples a table C<block.csv> is created for a file
+C<somefile.pl>:
+
+=over 4
+
+=item *
+This selects both C<subs> and C<packages> which have 20 or more lines of code.
+This can be useful in code which contains multiple packages.
+
+    perltidy -dbs -dbt='sub package' somefile.pl >blocks.csv
+
+=item *
+This selects block types C<sub for foreach while> with 10 or more code lines.
+
+    perltidy -dbs -dbl=10 -dbt='sub for foreach while' somefile.pl >blocks.csv
+
+=item *
+This selects blocks with 2 or more code lines which are type C<sub> or which
+are inner loops.
+
+    perltidy -dbs -dbl=2 -dbt='sub +' somefile.pl >blocks.csv
+
+=item *
+This selects every block and package.
+
+    perltidy -dbs -dbl=1 -dbt='* closure' somefile.pl >blocks.csv
+
+=back
+
+
 =item B<Working with MakeMaker, AutoLoader and SelfLoader>
 
 The first $VERSION line of a file which might be eval'd by MakeMaker
@@ -4830,13 +5248,13 @@ ignored.
 
 Use this flag to specify the extra file extension of the table of contents file
 when html frames are used.  The default is "toc".
-See L<Specifying File Extensions>.
+See L<"Specifying File Extensions">.
 
 =item  The B<-sext=s>, or B<--html-src-extension> flag
 
 Use this flag to specify the extra file extension of the content file when html
 frames are used.  The default is "src".
-See L<Specifying File Extensions>.
+See L<"Specifying File Extensions">.
 
 =item  The B<-hent>, or B<--html-entities> flag
 
@@ -5024,23 +5442,24 @@ dot is added, and the backup file will be F<somefile.pl~>  .
 The following list shows all short parameter names which allow a prefix
 'n' to produce the negated form:
 
- D      anl    asbl   asc    ast    asu    atnl   aws    b      baa
- baao   bar    bbao   bbb    bbc    bbs    bl     bli    boa    boc
- bok    bol    bom    bos    bot    cblx   ce     conv   cs     csc
- cscb   cscw   dac    dbc    dcbl   dcsc   ddf    dln    dnl    dop
- dp     dpro   dsc    dsm    dsn    dtt    dwls   dwrs   dws    eos
- f      fll    fpva   frm    fs     fso    gcs    hbc    hbcm   hbco
- hbh    hbhh   hbi    hbj    hbk    hbm    hbn    hbp    hbpd   hbpu
- hbq    hbs    hbsc   hbv    hbw    hent   hic    hicm   hico   hih
- hihh   hii    hij    hik    him    hin    hip    hipd   hipu   hiq
- his    hisc   hiv    hiw    hsc    html   ibc    icb    icp    iob
- isbc   iscl   kgb    kgbd   kgbi   kis    lal    log    lop    lp
- lsl    mem    nib    ohbr   okw    ola    olc    oll    olq    opr
- opt    osbc   osbr   otr    ple    pod    pvl    q      sac    sbc
- sbl    scbb   schb   scp    scsb   sct    se     sfp    sfs    skp
- sob    sobb   sohb   sop    sosb   sot    ssc    st     sts    t
- tac    tbc    toc    tp     tqw    trp    ts     tsc    tso    vbc
- vc     vmll   vsc    w      wn     x      xci    xlp    xs
+ D      anl    asbl   asc    ast    asu    atc    atnl   aws    b
+ baa    baao   bar    bbao   bbb    bbc    bbs    bl     bli    boa
+ boc    bok    bol    bom    bos    bot    cblx   ce     conv   cpb
+ cs     csc    cscb   cscw   dac    dbc    dbs    dcbl   dcsc   ddf
+ dln    dnl    dop    dp     dpro   drc    dsc    dsm    dsn    dtc
+ dtt    dwic   dwls   dwrs   dws    eos    f      fll    fpva   frm
+ fs     fso    gcs    hbc    hbcm   hbco   hbh    hbhh   hbi    hbj
+ hbk    hbm    hbn    hbp    hbpd   hbpu   hbq    hbs    hbsc   hbv
+ hbw    hent   hic    hicm   hico   hih    hihh   hii    hij    hik
+ him    hin    hip    hipd   hipu   hiq    his    hisc   hiv    hiw
+ hsc    html   ibc    icb    icp    iob    isbc   iscl   kgb    kgbd
+ kgbi   kis    lal    log    lop    lp     lsl    mem    nib    ohbr
+ okw    ola    olc    oll    olq    opr    opt    osbc   osbr   otr
+ ple    pod    pvl    q      sac    sbc    sbl    scbb   schb   scp
+ scsb   sct    se     sfp    sfs    skp    sob    sobb   sohb   sop
+ sosb   sot    ssc    st     sts    t      tac    tbc    toc    tp
+ tqw    trp    ts     tsc    tso    vbc    vc     vmll   vsc    w
+ wfc    wn     x      xci    xlp    xs
 
 Equivalently, the prefix 'no' or 'no-' on the corresponding long names may be
 used.
@@ -5139,16 +5558,14 @@ The perltidy binary uses the Perl::Tidy module and is installed when that module
 
 =head1 VERSION
 
-This man page documents perltidy version 20220217
+This man page documents perltidy version 20230309
 
 =head1 BUG REPORTS
 
-A list of current bugs and issues can be found at the CPAN site L<https://rt.cpan.org/Public/Dist/Display.html?Name=Perl-Tidy>
-
-To report a new bug or problem, use the link on this page.
-
 The source code repository is at L<https://github.com/perltidy/perltidy>.
 
+To report a new bug or problem, use the "issues" link on this page.
+
 =head1 COPYRIGHT
 
 Copyright (c) 2000-2022 by Steve Hancock