]> git.donarmstrong.com Git - perltidy.git/blob - CHANGES
1d8905b0488525e9b90cbebd2849c0abf88c6ece
[perltidy.git] / CHANGES
1 Perltidy Change Log
2   2010 12 17
3      - added new flag -it=n or --iterations=n
4        This flag causes perltidy to do n complete iterations.  
5        For most purposes the default of n=1 should be satisfactory.  However n=2
6        can be useful when a major style change is being made, or when code is being
7        beautified on check-in to a source code control system.  The run time will be
8        approximately proportional to n, and it should seldom be necessary to use a
9        value greater than n=2.  Thanks to Jonathan Swartz
10
11      - A configuration file pathname begins with three dots, e.g.
12        ".../.perltidyrc", indicates that the file should be searched for starting
13        in the current directory and working upwards. This makes it easier to have
14        multiple projects each with their own .perltidyrc in their root directories.
15        Thanks to Jonathan Swartz for this patch.
16
17      - Added flag --notidy which disables all formatting and causes the input to be
18        copied unchanged.  This can be useful in conjunction with hierarchical
19        F<.perltidyrc> files to prevent unwanted tidying.
20        Thanks to Jonathan Swartz for this patch.
21
22      - Added prefilters and postfilters in the call to the Tidy.pm module.
23        Prefilters and postfilters. The prefilter is a code reference that 
24        will be applied to the source before tidying, and the postfilter 
25        is a code reference to the result before outputting.  
26
27        Thanks to Jonathan Swartz for this patch.  He writes:
28        This is useful for all manner of customizations. For example, I use
29        it to convert the 'method' keyword to 'sub' so that perltidy will work for
30        Method::Signature::Simple code:
31
32        Perl::Tidy::perltidy(
33           prefilter => sub { $_ = $_[0]; s/^method (.*)/sub $1 \#__METHOD/gm; return $_ },
34           postfilter => sub { $_ = $_[0]; s/^sub (.*?)\s* \#__METHOD/method $1/gm; return $_ }
35        );
36
37      - The starting indentation level of sections of code entabbed with -et=n
38        is correctly guessed if it was also produced with the same -et=n flag.  This
39        keeps the indentation stable on repeated formatting passes within an editor.
40        Thanks to Sam Kington and Glenn.
41
42      - Functions with prototype '&' had a space between the function and opening
43        peren.  This space now only occurs if the flag --space-function-paren (-sfp)
44        is set.  Thanks to Zrajm Akfohg.
45
46      - Patch to never put spaces around a bare word in braces beginning with ^ as in:
47          my $before = ${^PREMATCH};
48        even if requested with the -bt=0 flag because any spaces cause a syntax error in perl.
49        Thanks to Fabrice Dulanoy.
50
51   2009 06 16
52      - Allow configuration file to be 'perltidy.ini' for Windows systems.
53        i.e. C:\Documents and Settings\User\perltidy.ini
54        and added documentation for setting configuation file under Windows in man
55        page.  Thanks to Stuart Clark.
56
57      - Corrected problem of unwanted semicolons in hash ref within given/when code.
58       Thanks to Nelo Onyiah.
59
60      - added new flag -cscb or --closing-side-comments-balanced
61       When using closing-side-comments, and the closing-side-comment-maximum-text
62       limit is exceeded, then the comment text must be truncated.  Previous
63       versions of perltidy terminate with three dots, and this can still be
64       achieved with -ncscb:
65        
66    perltidy -csc -ncscb
67
68        } ## end foreach my $foo (sort { $b cmp $a ...
69        
70   However this causes a problem with older editors which cannot recognize
71       comments or are not configured to doso because they cannot "bounce" around in
72       the text correctly.  The B<-cscb> flag tries to help them by 
73       appending appropriate terminal balancing structure:
74        
75    perltidy -csc -cscb
76
77        } ## end foreach my $foo (sort { $b cmp $a ... })
78        
79   Since there is much to be gained and little to be lost by doing this,
80       the default is B<-cscb>.  Use B<-ncscb> if you do not want this.
81
82       Thanks to Daniel Becker for suggesting this option.
83
84      - After an isolated closing eval block the continuation indentation will be
85        removed so that the braces line up more like other blocks.  Thanks to Yves Orton.
86
87      OLD:
88         eval {
89             #STUFF;
90             1;    # return true
91           }  
92           or do {
93             #handle error
94           };
95
96      NEW:
97         eval {
98             #STUFF;
99             1;    # return true
100         } or do {
101             #handle error
102         };
103
104      -A new flag -asbl (or --opening-anonymous-sub-brace-on-new-line) has
105       been added to put the opening brace of anonymous sub's on a new line,
106       as in the following snippet:
107
108         my $code = sub
109         {
110             my $arg = shift;
111             return $arg->(@_);
112         };
113
114       This was not possible before because the -sbl flag only applies to named
115       subs. Thanks to Benjamin Krupp.
116
117      -Fix tokenization bug with the following snippet
118        print 'hi' if { x => 1, }->{x};
119       which resulted in a semicolon being added after the comma.  The workaround
120       was to use -nasc, but this is no longer necessary.  Thanks to Brian Duggan. 
121
122      -Fixed problem in which an incorrect error message could be triggered
123      by the (unusual) combination of parameters  -lp -i=0 -l=2 -ci=0 for
124      example.  Thanks to Richard Jelinek.
125
126      -A new flag --keep-old-blank-lines=n has been added to
127      give more control over the treatment of old blank lines in
128      a script.  The manual has been revised to discuss the new
129      flag and clarify the treatment of old blank lines.  Thanks
130      to Oliver Schaefer.
131
132   2007 12 05
133      -Improved support for perl 5.10: New quote modifier 'p', new block type UNITCHECK, 
134      new keyword break, improved formatting of given/when.
135
136      -Corrected tokenization bug of something like $var{-q}.
137
138      -Numerous minor formatting improvements.
139
140      -Corrected list of operators controlled by -baao -bbao to include
141        . : ? && || and or err xor
142
143      -Corrected very minor error in log file involving incorrect comment
144      regarding need for upper case of labels.  
145
146      -Fixed problem where perltidy could run for a very long time
147      when given certain non-perl text files.
148
149      -Line breaks in un-parenthesized lists now try to follow
150      line breaks in the input file rather than trying to fill
151      lines.  This usually works better, but if this causes
152      trouble you can use -iob to ignore any old line breaks.
153      Example for the following input snippet:
154
155         print
156         "conformability (Not the same dimension)\n",
157         "\t", $have, " is ", text_unit($hu), "\n",
158         "\t", $want, " is ", text_unit($wu), "\n",
159         ;
160
161       OLD:
162         print "conformability (Not the same dimension)\n", "\t", $have, " is ",
163           text_unit($hu), "\n", "\t", $want, " is ", text_unit($wu), "\n",;
164
165       NEW:
166         print "conformability (Not the same dimension)\n",
167           "\t", $have, " is ", text_unit($hu), "\n",
168           "\t", $want, " is ", text_unit($wu), "\n",
169           ;
170
171   2007 08 01
172      -Added -fpsc option (--fixed-position-side-comment). Thanks to Ueli Hugenschmidt. 
173      For example -fpsc=40 tells perltidy to put side comments in column 40
174      if possible.  
175
176      -Added -bbao and -baao options (--break-before-all-operators and
177      --break-after-all-operators) to simplify command lines and configuration
178      files.  These define an initial preference for breaking at operators which can
179      be modified with -wba and -wbb flags.  For example to break before all operators
180      except an = one could use --bbao -wba='=' rather than listing every
181      single perl operator (except =) on a -wbb flag.
182
183      -Added -kis option (--keep-interior-semicolons).  Use the B<-kis> flag
184      to prevent breaking at a semicolon if there was no break there in the
185      input file.  To illustrate, consider the following input lines:
186
187         dbmclose(%verb_delim); undef %verb_delim;
188         dbmclose(%expanded); undef %expanded;
189         dbmclose(%global); undef %global;
190
191      Normally these would be broken into six lines, but 
192      perltidy -kis gives:
193
194         dbmclose(%verb_delim); undef %verb_delim;
195         dbmclose(%expanded);   undef %expanded;
196         dbmclose(%global);     undef %global;
197      
198  -Improved formatting of complex ternary statements, with indentation
199      of nested statements.  
200       OLD:
201         return defined( $cw->{Selected} )
202           ? (wantarray)
203           ? @{ $cw->{Selected} }
204           : $cw->{Selected}[0]
205           : undef;
206
207       NEW:
208         return defined( $cw->{Selected} )
209           ? (wantarray)
210               ? @{ $cw->{Selected} }
211               : $cw->{Selected}[0]
212           : undef;
213
214      -Text following un-parenthesized if/unless/while/until statements get a
215      full level of indentation.  Suggested by Jeff Armstorng and others. 
216      OLD:
217         return $ship->chargeWeapons("phaser-canon")
218           if $encounter->description eq 'klingon'
219           and $ship->firepower >= $encounter->firepower
220           and $location->status ne 'neutral';
221      NEW:
222         return $ship->chargeWeapons("phaser-canon")
223           if $encounter->description eq 'klingon'
224               and $ship->firepower >= $encounter->firepower
225               and $location->status ne 'neutral';
226
227   2007 05 08
228      -Fixed bug where #line directives were being indented.  Thanks to
229      Philippe Bruhat.
230
231   2007 05 04
232      -Fixed problem where an extra blank line was added after an =cut when either
233      (a) the =cut started (not stopped) a POD section, or (b) -mbl > 1. 
234      Thanks to J. Robert Ray and Bill Moseley.
235
236   2007 04 24
237      -ole (--output-line-ending) and -ple (--preserve-line-endings) should
238      now work on all systems rather than just unix systems. Thanks to Dan
239      Tyrell.
240
241      -Fixed problem of a warning issued for multiple subs for BEGIN subs
242      and other control subs. Thanks to Heiko Eissfeldt.
243      
244  -Fixed problem where no space was introduced between a keyword or
245      bareword and a colon, such as:
246
247      ( ref($result) eq 'HASH' && !%$result ) ? undef: $result;
248
249      Thanks to Niek.
250
251      -Added a utility program 'break_long_quotes.pl' to the examples directory of
252      the distribution.  It breaks long quoted strings into a chain of concatenated
253      sub strings no longer than a selected length.  Suggested by Michael Renner as
254      a perltidy feature but was judged to be best done in a separate program.
255
256      -Updated docs to remove extra < and >= from list of tokens 
257      after which breaks are made by default.  Thanks to Bob Kleemann.
258
259      -Removed improper uses of $_ to avoid conflicts with external calls, giving
260      error message similar to:
261         Modification of a read-only value attempted at 
262         /usr/share/perl5/Perl/Tidy.pm line 6907.
263      Thanks to Michael Renner.
264
265      -Fixed problem when errorfile was not a plain filename or filehandle
266      in a call to Tidy.pm.  The call
267      perltidy(source => \$input, destination => \$output, errorfile => \$err);
268      gave the following error message:
269       Not a GLOB reference at /usr/share/perl5/Perl/Tidy.pm line 3827.
270      Thanks to Michael Renner and Phillipe Bruhat.
271
272      -Fixed problem where -sot would not stack an opening token followed by
273      a side comment.  Thanks to Jens Schicke.
274
275      -improved breakpoints in complex math and other long statements. Example:
276      OLD:
277         return
278           log($n) + 0.577215664901532 + ( 1 / ( 2 * $n ) ) -
279           ( 1 / ( 12 * ( $n**2 ) ) ) + ( 1 / ( 120 * ( $n**4 ) ) );
280      NEW:
281         return
282           log($n) + 0.577215664901532 +
283           ( 1 / ( 2 * $n ) ) -
284           ( 1 / ( 12 * ( $n**2 ) ) ) +
285           ( 1 / ( 120 * ( $n**4 ) ) );
286
287      -more robust vertical alignment of complex terminal else blocks and ternary
288      statements.
289
290   2006 07 19
291      -Eliminated bug where a here-doc invoked through an 'e' modifier on a pattern
292      replacement text was not recognized.  The tokenizer now recursively scans
293      replacement text (but does not reformat it).
294
295      -improved vertical alignment of terminal else blocks and ternary statements.
296       Thanks to Chris for the suggestion. 
297
298       OLD:
299         if    ( IsBitmap() ) { return GetBitmap(); }
300         elsif ( IsFiles() )  { return GetFiles(); }
301         else { return GetText(); }
302
303       NEW:
304         if    ( IsBitmap() ) { return GetBitmap(); }
305         elsif ( IsFiles() )  { return GetFiles(); }
306         else                 { return GetText(); }
307
308       OLD:
309         $which_search =
310             $opts{"t"} ? 'title'
311           : $opts{"s"} ? 'subject'
312           : $opts{"a"} ? 'author'
313           : 'title';
314
315       NEW:
316         $which_search =
317             $opts{"t"} ? 'title'
318           : $opts{"s"} ? 'subject'
319           : $opts{"a"} ? 'author'
320           :              'title';
321
322      -improved indentation of try/catch blocks and other externally defined
323      functions accepting a block argument.  Thanks to jae.
324
325      -Added support for Perl 5.10 features say and smartmatch.
326
327      -Added flag -pbp (--perl-best-practices) as an abbreviation for parameters
328      suggested in Damian Conway's "Perl Best Practices".  -pbp is the same as:
329
330         -l=78 -i=4 -ci=4 -st -se -vt=2 -cti=0 -pt=1 -bt=1 -sbt=1 -bbt=1 -nsfs -nolq
331         -wbb="% + - * / x != == >= <= =~ !~ < > | & >= < = 
332               **= += *= &= <<= &&= -= /= |= >>= ||= .= %= ^= x="
333
334       Please note that the -st here restricts input to standard input; use
335       -nst if necessary to override.
336
337      -Eliminated some needless breaks at equals signs in -lp indentation.
338
339         OLD:
340             $c =
341               Math::Complex->make(LEFT + $x * (RIGHT - LEFT) / SIZE,
342                                   TOP + $y * (BOTTOM - TOP) / SIZE);
343         NEW:
344             $c = Math::Complex->make(LEFT + $x * (RIGHT - LEFT) / SIZE,
345                                      TOP + $y * (BOTTOM - TOP) / SIZE);
346
347      A break at an equals is sometimes useful for preventing complex statements 
348      from hitting the line length limit.  The decision to do this was 
349      over-eager in some cases and has been improved.  Thanks to Royce Reece.
350
351      -qw quotes contained in braces, square brackets, and parens are being
352      treated more like those containers as far as stacking of tokens.  Also
353      stack of closing tokens ending ');' will outdent to where the ');' would
354      have outdented if the closing stack is matched with a similar opening stack.
355
356       OLD: perltidy -soc -sct
357         __PACKAGE__->load_components(
358             qw(
359               PK::Auto
360               Core
361               )
362         );
363       NEW: perltidy -soc -sct
364         __PACKAGE__->load_components( qw(
365               PK::Auto
366               Core
367         ) );
368       Thanks to Aran Deltac
369
370      -Eliminated some undesirable or marginally desirable vertical alignments.
371      These include terminal colons, opening braces, and equals, and particularly
372      when just two lines would be aligned.
373
374      OLD:
375         my $accurate_timestamps = $Stamps{lnk};
376         my $has_link            = 
377             ...
378      NEW:
379         my $accurate_timestamps = $Stamps{lnk};
380         my $has_link =
381
382      -Corrected a problem with -mangle in which a space would be removed
383      between a keyword and variable beginning with ::.
384
385   2006 06 14
386      -Attribute argument lists are now correctly treated as quoted strings
387      and not formatted.  This is the most important update in this version.
388      Thanks to Borris Zentner, Greg Ferguson, Steve Kirkup.
389
390      -Updated to recognize the defined or operator, //, to be released in Perl 10.
391      Thanks to Sebastien Aperghis-Tramoni.
392
393      -A useful utility perltidyrc_dump.pl is included in the examples section.  It
394      will read any perltidyrc file and write it back out in a standard format
395      (though comments are lost).
396
397      -Added option to have perltidy read and return a hash with the contents of a
398      perltidyrc file.  This may be used by Leif Eriksen's tidyview code.  This
399      feature is used by the demonstration program 'perltidyrc_dump.pl' in the
400      examples directory.
401
402      -Improved error checking in perltidyrc files.  Unknown bare words were not
403      being caught.
404
405      -The --dump-options parameter now dumps parameters in the format required by a
406      perltidyrc file.
407
408      -V-Strings with underscores are now recognized.
409      For example: $v = v1.2_3; 
410
411      -cti=3 option added which gives one extra indentation level to closing 
412      tokens always.  This provides more predictable closing token placement
413      than cti=2.  If you are using cti=2 you might want to try cti=3.
414
415      -To identify all left-adjusted comments as static block comments, use C<-sbcp='^#'>.
416
417      -New parameters -fs, -fsb, -fse added to allow sections of code between #<<<
418      and #>>> to be passed through verbatim. This is enabled by default and turned
419      off by -nfs.  Flags -fsb and -fse allow other beginning and ending markers.
420      Thanks to Wolfgang Werner and Marion Berryman for suggesting this.  
421
422      -added flag -skp to put a space between all Perl keywords and following paren.
423      The default is to only do this for certain keywords.  Suggested by
424      H.Merijn Brand.
425
426      -added flag -sfp to put a space between a function name and following paren.
427      The default is not to do this.  Suggested by H.Merijn Brand.
428
429      -Added patch to avoid breaking GetOpt::Long::Configure set by calling program. 
430      Thanks to Philippe Bruhat.
431
432      -An error was fixed in which certain parameters in a .perltidyrc file given
433      without the equals sign were not recognized.  That is,
434      '--brace-tightness 0' gave an error but '--brace-tightness=0' worked
435      ok.  Thanks to Zac Hansen.
436
437      -An error preventing the -nwrs flag from working was corrected. Thanks to
438       Greg Ferguson.
439
440      -Corrected some alignment problems with entab option.
441
442      -A bug with the combination of -lp and -extrude was fixed (though this
443      combination doesn't really make sense).  The bug was that a line with
444      a single zero would be dropped.  Thanks to Cameron Hayne.
445
446      -Updated Windows detection code to avoid an undefined variable.
447      Thanks to Joe Yates and Russ Jones.
448
449      -Improved formatting for short trailing statements following a closing paren.
450      Thanks to Joe Matarazzo.
451
452      -The handling of the -icb (indent closing block braces) flag has been changed
453      slightly to provide more consistent and predictable formatting of complex
454      structures.  Instead of giving a closing block brace the indentation of the
455      previous line, it is now given one extra indentation level.  The two methods
456      give the same result if the previous line was a complete statement, as in this
457      example:
458
459             if ($task) {
460                 yyy();
461                 }    # -icb
462             else {
463                 zzz();
464                 }
465      The change also fixes a problem with empty blocks such as:
466
467         OLD, -icb:
468         elsif ($debug) {
469         }
470
471         NEW, -icb:
472         elsif ($debug) {
473             }
474
475      -A problem with -icb was fixed in which a closing brace was misplaced when
476      it followed a quote which spanned multiple lines.
477
478      -Some improved breakpoints for -wba='&& || and or'
479
480      -Fixed problem with misaligned cuddled else in complex statements
481      when the -bar flag was also used.  Thanks to Alex and Royce Reese.
482
483      -Corrected documentation to show that --outdent-long-comments is the default.
484      Thanks to Mario Lia.
485
486      -New flag -otr (opening-token-right) is similar to -bar (braces-always-right)
487      but applies to non-structural opening tokens.
488
489      -new flags -sot (stack-opening-token), -sct (stack-closing-token).
490      Suggested by Tony.
491
492   2003 10 21
493      -The default has been changed to not do syntax checking with perl.  
494        Use -syn if you want it.  Perltidy is very robust now, and the -syn
495        flag now causes more problems than it's worth because of BEGIN blocks
496        (which get executed with perl -c).  For example, perltidy will never
497        return when trying to beautify this code if -syn is used:
498
499             BEGIN { 1 while { }; }
500
501       Although this is an obvious error, perltidy is often run on untested
502       code which is more likely to have this sort of problem.  A more subtle
503       example is:
504
505             BEGIN { use FindBin; }
506
507       which may hang on some systems using -syn if a shared file system is
508       unavailable.
509
510      -Changed style -gnu to use -cti=1 instead of -cti=2 (see next item).
511       In most cases it looks better.  To recover the previous format, use
512       '-gnu -cti=2'
513
514      -Added flags -cti=n for finer control of closing token indentation.
515        -cti = 0 no extra indentation (default; same as -nicp)
516        -cti = 1 enough indentation so that the closing token
517             aligns with its opening token.
518        -cti = 2 one extra indentation level if the line has the form 
519               );   ];   or   };     (same as -icp).
520
521        The new option -cti=1 works well with -lp:
522
523        EXAMPLES:
524
525         # perltidy -lp -cti=1
526         @month_of_year = (
527                            'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
528                            'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'
529                          );
530
531         # perltidy -lp -cti=2
532         @month_of_year = (
533                            'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
534                            'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'
535                            );
536       This is backwards compatible with -icp. See revised manual for
537       details.  Suggested by Mike Pennington.
538       
539  -Added flag '--preserve-line-endings' or '-ple' to cause the output
540       line ending to be the same as in the input file, for unix, dos, 
541       or mac line endings.  Only works under unix. Suggested by 
542       Rainer Hochschild.
543
544      -Added flag '--output-line-ending=s' or '-ole=s' where s=dos or win,
545       unix, or mac.  Only works under unix.
546
547      -Files with Mac line endings should now be handled properly under unix
548       and dos without being passed through a converter.
549
550      -You may now include 'and', 'or', and 'xor' in the list following
551       '--want-break-after' to get line breaks after those keywords rather than
552       before them.  Suggested by Rainer Hochschild.
553
554      -Corrected problem with command line option for -vtc=n and -vt=n. The
555       equals sign was being eaten up by the Windows shell so perltidy didn't
556       see it.
557
558   2003 07 26
559      -Corrected cause of warning message with recent versions of Perl:
560         "Possible precedence problem on bitwise & operator at ..."
561       Thanks to Jim Files.
562
563      -fixed bug with -html with '=for pod2html' sections, in which code/pod
564      output order was incorrect.  Thanks to Tassilo von Parseval.
565
566      -fixed bug when the -html flag is used, in which the following error
567      message, plus others, appear:
568          did not see <body> in pod2html output
569      This was caused by a change in the format of html output by pod2html
570      VERSION 1.04 (included with perl 5.8).  Thanks to Tassilo von Parseval.
571
572      -Fixed bug where an __END__ statement would be mistaken for a label
573      if it is immediately followed by a line with a leading colon. Thanks
574      to John Bayes.
575      
576  -Implemented guessing logic for brace types when it is ambiguous.  This
577      has been on the TODO list a long time.  Thanks to Boris Zentner for
578      an example.
579
580      -Long options may now be negated either as '--nolong-option' 
581      or '--no-long-option'.  Thanks to Philip Newton for the suggestion.
582
583      -added flag --html-entities or -hent which controls the use of
584      Html::Entities for html formatting.  Use --nohtml-entities or -nhent to
585      prevent the use of Html::Entities to encode special symbols.  The
586      default is -hent.  Html::Entities when formatting perl text to escape
587      special symbols.  This may or may not be the right thing to do,
588      depending on browser/language combinations.  Thanks to Burak Gursoy for
589      this suggestion.
590
591      -Bareword strings with leading '-', like, '-foo' now count as 1 token
592      for horizontal tightness.  This way $a{'-foo'}, $a{foo}, and $a{-foo}
593      are now all treated similarly.  Thus, by default, OLD: $a{ -foo } will
594      now be NEW: $a{-foo}.  Suggested by Mark Olesen.
595
596      -added 2 new flags to control spaces between keywords and opening parens:
597        -sak=s  or --space-after-keyword=s,  and
598        -nsak=s or --nospace-after-keyword=s, where 's' is a list of keywords.
599
600      The new default list of keywords which get a space is:
601
602        "my local our and or eq ne if else elsif until unless while for foreach
603          return switch case given when"
604
605      Use -sak=s and -nsak=s to add and remove keywords from this list,
606         respectively.
607
608      Explanation: Stephen Hildrey noted that perltidy was being inconsistent
609      in placing spaces between keywords and opening parens, and sent a patch
610      to give user control over this.  The above list was selected as being
611      a reasonable default keyword list.  Previously, perltidy
612      had a hardwired list which also included these keywords:
613
614             push pop shift unshift join split die
615
616      but did not have 'our'.  Example: if you prefer to make perltidy behave
617      exactly as before, you can include the following two lines in your
618      .perltidyrc file: 
619
620        -sak="push pop local shift unshift join split die"
621        -nsak="our"
622
623      -Corrected html error in .toc file when -frm -html is used (extra ");
624       browsers were tolerant of it.
625
626      -Improved alignment of chains of binary and ?/: operators. Example:
627       OLD:
628         $leapyear =
629           $year % 4     ? 0
630           : $year % 100 ? 1
631           : $year % 400 ? 0
632           : 1;
633       NEW:
634         $leapyear =
635             $year % 4   ? 0
636           : $year % 100 ? 1
637           : $year % 400 ? 0
638           : 1;
639
640      -improved breakpoint choices involving '->'
641
642      -Corrected tokenization of things like ${#} or ${©}. For example,
643       ${©} is valid, but ${© } is a syntax error.
644
645      -Corrected minor tokenization errors with indirect object notation.
646       For example, 'new A::()' works now.
647
648      -Minor tokenization improvements; all perl code distributed with perl 5.8 
649       seems to be parsed correctly except for one instance (lextest.t) 
650       of the known bug.
651
652   2002 11 30
653      -Implemented scalar attributes.  Thanks to Sean Tobin for noting this.
654
655      -Fixed glitch introduced in previous release where -pre option
656      was not outputting a leading html <pre> tag.
657
658      -Numerous minor improvements in vertical alignment, including the following:
659
660      -Improved alignment of opening braces in many cases.  Needed for improved
661      switch/case formatting, and also suggested by Mark Olesen for sort/map/grep
662      formatting.  For example:
663
664       OLD:
665         @modified =
666           map { $_->[0] }
667           sort { $a->[1] <=> $b->[1] }
668           map { [ $_, -M ] } @filenames;
669
670       NEW:
671         @modified =
672           map  { $_->[0] }
673           sort { $a->[1] <=> $b->[1] }
674           map  { [ $_, -M ] } @filenames;
675
676      -Eliminated alignments across unrelated statements. Example:
677       OLD:
678         $borrowerinfo->configure( -state => 'disabled' );
679         $borrowerinfo->grid( -col        => 1, -row => 0, -sticky => 'w' );
680
681       NEW:  
682         $borrowerinfo->configure( -state => 'disabled' );
683         $borrowerinfo->grid( -col => 1, -row => 0, -sticky => 'w' );
684
685       Thanks to Mark Olesen for suggesting this.
686
687      -Improved alignement of '='s in certain cases.
688       Thanks to Norbert Gruener for sending an example.
689
690      -Outdent-long-comments (-olc) has been re-instated as a default, since
691       it works much better now.  Use -nolc if you want to prevent it.
692
693      -Added check for 'perltidy file.pl -o file.pl', which causes file.pl
694      to be lost. (The -b option should be used instead). Thanks to mreister
695      for reporting this problem.
696
697   2002 11 06
698      -Switch/case or given/when syntax is now recognized.  Its vertical alignment
699      is not great yet, but it parses ok.  The words 'switch', 'case', 'given',
700      and 'when' are now treated as keywords.  If this causes trouble with older
701      code, we could introduce a switch to deactivate it.  Thanks to Stan Brown
702      and Jochen Schneider for recommending this.
703
704      -Corrected error parsing sub attributes with call parameters.
705      Thanks to Marc Kerr for catching this.
706
707      -Sub prototypes no longer need to be on the same line as sub names.  
708
709      -a new flag -frm or --frames will cause html output to be in a
710      frame, with table of contents in the left panel and formatted source
711      in the right panel.  Try 'perltidy -html -frm somemodule.pm' for example.
712
713      -The new default for -html formatting is to pass the pod through Pod::Html.
714      The result is syntax colored code within your pod documents. This can be
715      deactivated with -npod.  Thanks to those who have written to discuss this,
716      particularly Mark Olesen and Hugh Myers.
717
718      -the -olc (--outdent-long-comments) option works much better.  It now outdents
719      groups of consecutive comments together, and by just the amount needed to
720      avoid having any one line exceeding the maximum line length.
721
722      -block comments are now trimmed of trailing whitespace.
723
724      -if a directory specified with -opath does not exist, it will be created.
725
726      -a table of contents to packages and subs is output when -html is used.
727      Use -ntoc to prevent this. 
728
729      -fixed an unusual bug in which a 'for' statement following a 'format'
730      statement was not correctly tokenized.  Thanks to Boris Zentner for
731      catching this.
732
733      -Tidy.pm is no longer dependent on modules IO::Scalar and IO::ScalarArray.  
734      There were some speed issues.  Suggested by Joerg Walter.
735
736      -The treatment of quoted wildcards (file globs) is now system-independent. 
737      For example
738
739         perltidy 'b*x.p[lm]'
740
741      would match box.pl, box.pm, brinx.pm under any operating system.  Of
742      course, anything unquoted will be subject to expansion by any shell.
743
744      -default color for keywords under -html changed from 
745      SaddleBrown (#8B4513) to magenta4 (#8B008B).
746
747      -fixed an arg parsing glitch in which something like:
748        perltidy quick-help
749      would trigger the help message and exit, rather than operate on the
750      file 'quick-help'.
751
752   2002 09 22
753      -New option '-b' or '--backup-and-modify-in-place' will cause perltidy to
754      overwrite the original file with the tidied output file.  The original
755      file will be saved with a '.bak' extension (which can be changed with
756      -bext=s).  Thanks to Rudi Farkas for the suggestion.
757
758      -An index to all subs is included at the top of -html output, unless
759      only the <pre> section is written.
760
761      -Anchor lines of the form <a name="mysub"></a> are now inserted at key points
762      in html output, such as before sub definitions, for the convenience of
763      postprocessing scripts.  Suggested by Howard Owen.
764
765      -The cuddled-else (-ce) flag now also makes cuddled continues, like
766      this:
767
768         while ( ( $pack, $file, $line ) = caller( $i++ ) ) {
769            # bla bla
770         } continue {
771             $prevpack = $pack;
772         }
773
774      Suggested by Simon Perreault.  
775
776      -Fixed bug in which an extra blank line was added before an =head or 
777      similar pod line after an __END__ or __DATA__ line each time 
778      perltidy was run.  Also, an extra blank was being added after
779      a terminal =cut.  Thanks to Mike Birdsall for reporting this.
780
781   2002 08 26
782      -Fixed bug in which space was inserted in a hyphenated hash key:
783         my $val = $myhash{USER-NAME};
784       was converted to:
785         my $val = $myhash{USER -NAME}; 
786       Thanks to an anonymous bug reporter at sourceforge.
787
788      -Fixed problem with the '-io' ('--indent-only') where all lines 
789       were double spaced.  Thanks to Nick Andrew for reporting this bug.
790
791      -Fixed tokenization error in which something like '-e1' was 
792       parsed as a number. 
793
794      -Corrected a rare problem involving older perl versions, in which 
795       a line break before a bareword caused problems with 'use strict'.
796       Thanks to Wolfgang Weisselberg for noting this.
797
798      -More syntax error checking added.
799
800      -Outdenting labels (-ola) has been made the default, in order to follow the
801       perlstyle guidelines better.  It's probably a good idea in general, but
802       if you do not want this, use -nola in your .perltidyrc file.
803       
804  -Updated rules for padding logical expressions to include more cases.
805       Thanks to Wolfgang Weisselberg for helpful discussions.
806
807      -Added new flag -osbc (--outdent-static-block-comments) which will
808       outdent static block comments by 2 spaces (or whatever -ci equals).
809       Requested by Jon Robison.
810
811   2002 04 25
812      -Corrected a bug, introduced in the previous release, in which some
813       closing side comments (-csc) could have incorrect text.  This is
814       annoying but will be correct the next time perltidy is run with -csc.
815
816      -Implemented XHTML patch submitted by Ville Skyttä.
817
818      -Fixed bug where whitespace was being removed between 'Bar' and '()' 
819       in a use statement like:
820
821            use Foo::Bar ();
822
823       Thanks to Ville Skyttä for reporting this.
824
825      -Whenever possible, if a logical expression is broken with leading
826       '&&', '||', 'and', or 'or', then the leading line will be padded
827       with additional space to produce alignment.  This has been on the
828       todo list for a long time; thanks to Frank Steinhauer for reminding
829       me to do it.  Notice the first line after the open parens here:
830
831             OLD: perltidy -lp
832             if (
833                  !param("rules.to.$linecount")
834                  && !param("rules.from.$linecount")
835                  && !param("rules.subject.$linecount")
836                  && !(
837                        param("rules.fieldname.$linecount")
838                        && param("rules.fieldval.$linecount")
839                  )
840                  && !param("rules.size.$linecount")
841                  && !param("rules.custom.$linecount")
842               )
843
844             NEW: perltidy -lp
845             if (
846                     !param("rules.to.$linecount")
847                  && !param("rules.from.$linecount")
848                  && !param("rules.subject.$linecount")
849                  && !(
850                           param("rules.fieldname.$linecount")
851                        && param("rules.fieldval.$linecount")
852                  )
853                  && !param("rules.size.$linecount")
854                  && !param("rules.custom.$linecount")
855               )
856
857   2002 04 16
858      -Corrected a mistokenization of variables for a package with a name
859       equal to a perl keyword.  For example: 
860
861          my::qx();
862          package my;
863          sub qx{print "Hello from my::qx\n";}
864
865       In this case, the leading 'my' was mistokenized as a keyword, and a
866       space was being place between 'my' and '::'.  This has been
867       corrected.  Thanks to Martin Sluka for discovering this. 
868
869      -A new flag -bol (--break-at-old-logic-breakpoints)
870       has been added to control whether containers with logical expressions
871       should be broken open.  This is the default.
872
873      -A new flag -bok (--break-at-old-keyword-breakpoints)
874       has been added to follow breaks at old keywords which return lists,
875       such as sort and map.  This is the default.
876
877      -A new flag -bot (--break-at-old-trinary-breakpoints) has been added to
878       follow breaks at trinary (conditional) operators.  This is the default.
879
880      -A new flag -cab=n has been added to control breaks at commas after
881       '=>' tokens.  The default is n=1, meaning break unless this breaks
882       open an existing on-line container.
883
884      -A new flag -boc has been added to allow existing list formatting
885       to be retained.  (--break-at-old-comma-breakpoints).  See updated manual.
886
887      -A new flag -iob (--ignore-old-breakpoints) has been added to
888       prevent the locations of old breakpoints from influencing the output
889       format.
890
891      -Corrected problem where nested parentheses were not getting full
892       indentation.  This has been on the todo list for some time; thanks 
893       to Axel Rose for a snippet demonstrating this issue.
894
895                 OLD: inner list is not indented
896                 $this->sendnumeric(
897                     $this->server,
898                     (
899                       $ret->name,        $user->username, $user->host,
900                     $user->server->name, $user->nick,     "H"
901                     ),
902                 );
903
904                 NEW:
905                 $this->sendnumeric(
906                     $this->server,
907                     (
908                         $ret->name,          $user->username, $user->host,
909                         $user->server->name, $user->nick,     "H"
910                     ),
911                 );
912
913      -Code cleaned up by removing the following unused, undocumented flags.
914       They should not be in any .perltidyrc files because they were just
915       experimental flags which were never documented.  Most of them placed
916       artificial limits on spaces, and Wolfgang Weisselberg convinced me that
917       most of them they do more harm than good by causing unexpected results.
918
919       --maximum-continuation-indentation (-mci)
920       --maximum-whitespace-columns
921       --maximum-space-to-comment (-xsc)
922       --big-space-jump (-bsj)
923
924      -Pod file 'perltidy.pod' has been appended to the script 'perltidy', and
925       Tidy.pod has been append to the module 'Tidy.pm'.  Older MakeMaker's
926       were having trouble.
927      
928  -A new flag -isbc has been added for more control on comments. This flag
929       has the effect that if there is no leading space on the line, then the
930       comment will not be indented, and otherwise it may be.  If both -ibc and
931       -isbc are set, then -isbc takes priority.  Thanks to Frank Steinhauer
932       for suggesting this.
933
934      -A new document 'stylekey.pod' has been created to quickly guide new users
935       through the maze of perltidy style parameters.  An html version is 
936       on the perltidy web page.  Take a look! It should be very helpful.
937
938      -Parameters for controlling 'vertical tightness' have been added:
939       -vt and -vtc are the main controls, but finer control is provided
940       with -pvt, -pcvt, -bvt, -bcvt, -sbvt, -sbcvt.  Block brace vertical
941       tightness controls have also been added.
942       See updated manual and also see 'stylekey.pod'. Simple examples:
943
944         # perltidy -lp -vt=1 -vtc=1
945         @month_of_year = ( 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
946                            'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec' );
947
948         # perltidy -lp -vt=1 -vtc=0
949         @month_of_year = ( 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
950                            'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'
951         );
952
953      -Lists which do not format well in uniform columns are now better
954       identified and formated.
955
956         OLD:
957         return $c->create( 'polygon', $x, $y, $x + $ruler_info{'size'},
958             $y + $ruler_info{'size'}, $x - $ruler_info{'size'},
959             $y + $ruler_info{'size'} );
960
961         NEW:
962         return $c->create(
963             'polygon', $x, $y,
964             $x + $ruler_info{'size'},
965             $y + $ruler_info{'size'},
966             $x - $ruler_info{'size'},
967             $y + $ruler_info{'size'}
968         );
969
970         OLD:
971           radlablist($f1, pad('Initial', $p), $b->{Init}->get_panel_ref, 'None ',
972                      'None', 'Default', 'Default', 'Simple', 'Simple');
973         NEW:
974           radlablist($f1,
975                      pad('Initial', $p),
976                      $b->{Init}->get_panel_ref,
977                      'None ', 'None', 'Default', 'Default', 'Simple', 'Simple');
978
979      -Corrected problem where an incorrect html filename was generated for 
980       external calls to Tidy.pm module.  Fixed incorrect html title when
981       Tidy.pm is called with IO::Scalar or IO::Array source.
982
983      -Output file permissons are now set as follows.  An output script file
984       gets the same permission as the input file, except that owner
985       read/write permission is added (otherwise, perltidy could not be
986       rerun).  Html output files use system defaults.  Previously chmod 0755
987       was used in all cases.  Thanks to Mark Olesen for bringing this up.
988
989      -Missing semicolons will not be added in multi-line blocks of type
990       sort, map, or grep.  This brings perltidy into closer agreement
991       with common practice.  Of course, you can still put semicolons 
992       there if you like.  Thanks to Simon Perreault for a discussion of this.
993
994      -Most instances of extra semicolons are now deleted.  This is
995       particularly important if the -csc option is used.  Thanks to Wolfgang
996       Weisselberg for noting this.  For example, the following line
997       (produced by 'h2xs' :) has an extra semicolon which will now be
998       removed:
999
1000          BEGIN { plan tests => 1 };
1001
1002      -New parameter -csce (--closing-side-comment-else-flag) can be used
1003       to control what text is appended to 'else' and 'elsif' blocks.
1004       Default is to just add leading 'if' text to an 'else'.  See manual.
1005
1006      -The -csc option now labels 'else' blocks with additinal information
1007       from the opening if statement and elsif statements, if space.
1008       Thanks to Wolfgang Weisselberg for suggesting this.
1009
1010      -The -csc option will now remove any old closing side comments
1011       below the line interval threshold. Thanks to Wolfgang Weisselberg for
1012       suggesting this.
1013
1014      -The abbreviation feature, which was broken in the previous version,
1015       is now fixed.  Thanks to Michael Cartmell for noting this.
1016
1017      -Vertical alignment is now done for '||='  .. somehow this was 
1018       overlooked.
1019
1020   2002 02 25
1021      -This version uses modules for the first time, and a standard perl
1022       Makefile.PL has been supplied.  However, perltidy may still be
1023       installed as a single script, without modules.  See INSTALL for
1024       details.
1025
1026      -The man page 'perl2web' has been merged back into the main 'perltidy'
1027       man page to simplify installation.  So you may remove that man page
1028       if you have an older installation.
1029
1030      -Added patch from Axel Rose for MacPerl.  The patch prompts the user
1031       for command line arguments before calling the module 
1032       Perl::Tidy::perltidy.
1033
1034      -Corrected bug with '-bar' which was introduced in the previous
1035       version.  A closing block brace was being indented.  Thanks to
1036       Alexandros M Manoussakis for reporting this.
1037
1038      -New parameter '--entab-leading-whitespace=n', or '-et=n', has been
1039       added for those who prefer tabs.  This behaves different from the
1040       existing '-t' parameter; see updated man page.  Suggested by Mark
1041       Olesen.
1042
1043      -New parameter '--perl-syntax-check-flags=s'  or '-pcsf=s' can be
1044       used to change the flags passed to perltidy in a syntax check.
1045       See updated man page.  Suggested by Mark Olesen. 
1046
1047      -New parameter '--output-path=s'  or '-opath=s' will cause output
1048       files to be placed in directory s.  See updated man page.  Thanks for
1049       Mark Olesen for suggesting this.
1050
1051      -New parameter --dump-profile (or -dpro) will dump to
1052       standard output information about the search for a
1053       configuration file, the name of whatever configuration file
1054       is selected, and its contents.  This should help debugging
1055       config files, especially on different Windows systems.
1056
1057      -The -w parameter now notes possible errors of the form:
1058
1059             $comment = s/^\s*(\S+)\..*/$1/;   # trim whitespace
1060
1061      -Corrections added for a leading ':' and for leaving a leading 'tcsh'
1062       line untouched.  Mark Olesen reported that lines of this form were
1063       accepted by perl but not by perltidy:
1064
1065             : # use -*- perl -*-
1066             eval 'exec perl -wS $0 "$@"'  # shell should exec 'perl'
1067             unless 1;                     # but Perl should skip this one
1068
1069       Perl will silently swallow a leading colon on line 1 of a
1070       script, and now perltidy will do likewise.  For example,
1071       this is a valid script, provided that it is the first line,
1072       but not otherwise:
1073
1074             : print "Hello World\n";
1075       
1076   Also, perltidy will now mark a first line with leading ':' followed by
1077       '#' as type SYSTEM (just as a #!  line), not to be formatted.
1078
1079      -List formatting improved for certain lists with special
1080       initial terms, such as occur with 'printf', 'sprintf',
1081       'push', 'pack', 'join', 'chmod'.  The special initial term is
1082       now placed on a line by itself.  For example, perltidy -gnu
1083
1084          OLD:
1085             $Addr = pack(
1086                          "C4",                hex($SourceAddr[0]),
1087                          hex($SourceAddr[1]), hex($SourceAddr[2]),
1088                          hex($SourceAddr[3])
1089                          );
1090
1091          NEW:
1092             $Addr = pack("C4",
1093                          hex($SourceAddr[0]), hex($SourceAddr[1]),
1094                          hex($SourceAddr[2]), hex($SourceAddr[3]));
1095
1096           OLD:
1097                 push (
1098                       @{$$self{states}}, '64', '66', '68',
1099                       '70',              '72', '74', '76',
1100                       '78',              '80', '82', '84',
1101                       '86',              '88', '90', '92',
1102                       '94',              '96', '98', '100',
1103                       '102',             '104'
1104                       );
1105
1106           NEW:
1107                 push (
1108                       @{$$self{states}},
1109                       '64', '66', '68', '70', '72',  '74',  '76',
1110                       '78', '80', '82', '84', '86',  '88',  '90',
1111                       '92', '94', '96', '98', '100', '102', '104'
1112                       );
1113
1114      -Lists of complex items, such as matricies, are now detected
1115       and displayed with just one item per row:
1116
1117         OLD:
1118         $this->{'CURRENT'}{'gfx'}{'MatrixSkew'} = Text::PDF::API::Matrix->new(
1119             [ 1, tan( deg2rad($a) ), 0 ], [ tan( deg2rad($b) ), 1, 0 ],
1120             [ 0, 0, 1 ]
1121         );
1122
1123         NEW:
1124         $this->{'CURRENT'}{'gfx'}{'MatrixSkew'} = Text::PDF::API::Matrix->new(
1125             [ 1,                  tan( deg2rad($a) ), 0 ],
1126             [ tan( deg2rad($b) ), 1,                  0 ],
1127             [ 0,                  0,                  1 ]
1128         );
1129
1130      -The perl syntax check will be turned off for now when input is from
1131       standard input or standard output.  The reason is that this requires
1132       temporary files, which has produced far too many problems during
1133       Windows testing.  For example, the POSIX module under Windows XP/2000
1134       creates temporary names in the root directory, to which only the
1135       administrator should have permission to write.
1136
1137      -Merged patch sent by Yves Orton to handle appropriate
1138       configuration file locations for different Windows varieties
1139       (2000, NT, Me, XP, 95, 98).
1140
1141      -Added patch to properly handle a for/foreach loop without
1142       parens around a list represented as a qw.  I didn't know this
1143       was possible until Wolfgang Weisselberg pointed it out:
1144
1145             foreach my $key qw\Uno Due Tres Quadro\ {
1146                 print "Set $key\n";
1147             }
1148
1149       But Perl will give a syntax error without the $ variable; ie this will
1150       not work:
1151
1152             foreach qw\Uno Due Tres Quadro\ {
1153                 print "Set $_\n";
1154             }
1155
1156      -Merged Windows version detection code sent by Yves Orton.  Perltidy
1157       now automatically turns off syntax checking for Win 9x/ME versions,
1158       and this has solved a lot of robustness problems.  These systems 
1159       cannot reliably handle backtick operators.  See man page for
1160       details.
1161       
1162  -Merged VMS filename handling patch sent by Michael Cartmell.  (Invalid
1163       output filenames were being created in some cases). 
1164
1165      -Numerous minor improvements have been made for -lp style indentation.
1166
1167      -Long C-style 'for' expressions will be broken after each ';'.   
1168
1169       'perltidy -gnu' gives:
1170
1171         OLD:
1172         for ($status = $db->seq($key, $value, R_CURSOR()) ; $status == 0
1173              and $key eq $origkey ; $status = $db->seq($key, $value, R_NEXT())) 
1174
1175         NEW:
1176         for ($status = $db->seq($key, $value, R_CURSOR()) ;
1177              $status == 0 and $key eq $origkey ;
1178              $status = $db->seq($key, $value, R_NEXT()))
1179
1180      -For the -lp option, a single long term within parens
1181       (without commas) now has better alignment.  For example,
1182       perltidy -gnu
1183
1184                 OLD:
1185                 $self->throw("Must specify a known host, not $location,"
1186                       . " possible values ("
1187                       . join (",", sort keys %hosts) . ")");
1188
1189                 NEW:
1190                 $self->throw("Must specify a known host, not $location,"
1191                              . " possible values ("
1192                              . join (",", sort keys %hosts) . ")");
1193
1194   2001 12 31
1195      -This version is about 20 percent faster than the previous
1196       version as a result of optimization work.  The largest gain
1197       came from switching to a dispatch hash table in the
1198       tokenizer.
1199
1200      -perltidy -html will check to see if HTML::Entities is
1201       installed, and if so, it will use it to encode unsafe
1202       characters.
1203
1204      -Added flag -oext=ext to change the output file extension to
1205       be different from the default ('tdy' or 'html').  For
1206       example:
1207
1208         perltidy -html -oext=htm filename
1209
1210      will produce filename.htm
1211
1212      -Added flag -cscw to issue warnings if a closing side comment would replace
1213      an existing, different side comments.  See the man page for details.
1214      Thanks to Peter Masiar for helpful discussions.
1215
1216      -Corrected tokenization error of signed hex/octal/binary numbers. For
1217      example, the first hex number below would have been parsed correctly
1218      but the second one was not:
1219         if ( ( $tmp >= 0x80_00_00 ) || ( $tmp < -0x80_00_00 ) ) { }
1220
1221      -'**=' was incorrectly tokenized as '**' and '='.  This only
1222          caused a problem with the -extrude opton.
1223
1224      -Corrected a divide by zero when -extrude option is used
1225
1226      -The flag -w will now contain all errors reported by 'perl -c' on the
1227      input file, but otherwise they are not reported.  The reason is that
1228      perl will report lots of problems and syntax errors which are not of
1229      interest when only a small snippet is being formatted (such as missing
1230      modules and unknown bare words).  Perltidy will always report all
1231      significant syntax errors that it finds, such as unbalanced braces,
1232      unless the -q (quiet) flag is set.
1233
1234      -Merged modifications created by Hugh Myers into perltidy.
1235       These include a 'streamhandle' routine which allows perltidy
1236       as a module to operate on input and output arrays and strings
1237       in addition to files.  Documentation and new packaging as a
1238       module should be ready early next year; This is an elegant,
1239       powerful update; many thanks to Hugh for contributing it.
1240
1241   2001 11 28
1242      -added a tentative patch which tries to keep any existing breakpoints
1243      at lines with leading keywords map,sort,eval,grep. The idea is to
1244      improve formatting of sequences of list operations, as in a schwartzian
1245      transform.  Example:
1246
1247         INPUT:
1248         my @sorted = map { $_->[0] }
1249                      sort { $a->[1] <=> $b->[1] }
1250                      map { [ $_, rand ] } @list;
1251
1252         OLD:
1253         my @sorted =
1254           map { $_->[0] } sort { $a->[1] <=> $b->[1] } map { [ $_, rand ] } @list;
1255
1256         NEW:
1257         my @sorted = map { $_->[0] }
1258           sort { $a->[1] <=> $b->[1] }
1259           map { [ $_, rand ] } @list;
1260
1261       The new alignment is not as nice as the input, but this is an improvement.
1262       Thanks to Yves Orton for this suggestion.
1263
1264      -modified indentation logic so that a line with leading opening paren,
1265      brace, or square bracket will never have less indentation than the
1266      line with the corresponding opening token.  Here's a simple example:
1267
1268         OLD:
1269             $mw->Button(
1270                 -text    => "New Document",
1271                 -command => \&new_document
1272               )->pack(
1273                 -side   => 'bottom',
1274                 -anchor => 'e'
1275             );
1276
1277         Note how the closing ');' is lined up with the first line, even
1278         though it closes a paren in the 'pack' line.  That seems wrong.
1279      
1280     NEW:
1281             $mw->Button(
1282                 -text    => "New Document",
1283                 -command => \&new_document
1284               )->pack(
1285                 -side   => 'bottom',
1286                 -anchor => 'e'
1287               );
1288
1289        This seems nicer: you can up-arrow with an editor and arrive at the
1290        opening 'pack' line.
1291      
1292  -corrected minor glitch in which cuddled else (-ce) did not get applied
1293      to an 'unless' block, which should look like this:
1294
1295             unless ($test) {
1296
1297             } else {
1298
1299             }
1300
1301       Thanks to Jeremy Mates for reporting this.
1302
1303      -The man page has been reorganized to parameters easier to find.
1304      
1305  -Added check for multiple definitions of same subroutine.  It is easy
1306       to introduce this problem when cutting and pasting. Perl does not
1307       complain about it, but it can lead to disaster.
1308
1309      -The command -pro=filename  or -profile=filename may be used to specify a
1310       configuration file which will override the default name of .perltidyrc.
1311       There must not be a space on either side of the '=' sign.  I needed
1312       this to be able to easily test perltidy with a variety of different
1313       configuration files.
1314
1315      -Side comment alignment has been improved somewhat across frequent level
1316       changes, as in short if/else blocks.  Thanks to Wolfgang Weisselberg 
1317       for pointing out this problem.  For example:
1318         
1319     OLD:
1320         if ( ref $self ) {    # Called as a method
1321             $format = shift;
1322         }
1323         else {    # Regular procedure call
1324             $format = $self;
1325             undef $self;
1326         }
1327
1328         NEW:
1329         if ( ref $self ) {    # Called as a method
1330             $format = shift;
1331         }
1332         else {                # Regular procedure call
1333             $format = $self;
1334             undef $self;
1335         }
1336
1337      -New command -ssc (--static-side-comment) and related command allows
1338       side comments to be spaced close to preceding character.  This is
1339       useful for displaying commented code as side comments.
1340
1341      -New command -csc (--closing-side-comment) and several related
1342       commands allow comments to be added to (and deleted from) any or all
1343       closing block braces.  This can be useful if you have to maintain large
1344       programs, especially those that you didn't write.  See updated man page.
1345       Thanks to Peter Masiar for this suggestion.  For a simple example:
1346
1347             perltidy -csc
1348
1349             sub foo {
1350                 if ( !defined( $_[0] ) ) {
1351                     print("Hello, World\n");
1352                 }
1353                 else {
1354                     print( $_[0], "\n" );
1355                 }
1356             } ## end sub foo
1357
1358       This added '## end sub foo' to the closing brace.  
1359       To remove it, perltidy -ncsc.
1360
1361      -New commands -ola, for outdenting labels, and -okw, for outdenting
1362       selected control keywords, were implemented.  See the perltidy man
1363       page for details.  Thanks to Peter Masiar for this suggestion.
1364
1365      -Hanging side comment change: a comment will not be considered to be a
1366       hanging side comment if there is no leading whitespace on the line.
1367       This should improve the reliability of identifying hanging side comments.
1368       Thanks to Peter Masiar for this suggestion.
1369
1370      -Two new commands for outdenting, -olq (outdent-long-quotes) and -olc
1371       (outdent-long-comments), have been added.  The original -oll
1372       (outdent-long-lines) remains, and now is an abbreviation for -olq and -olc.
1373       The new default is just -olq.  This was necessary to avoid inconsistency with
1374       the new static block comment option.
1375
1376      -Static block comments:  to provide a way to display commented code
1377       better, the convention is used that comments with a leading '##' should
1378       not be formatted as usual.  Please see '-sbc' (or '--static-block-comment')
1379       for documentation.  It can be deactivated with with -nsbc, but
1380       should not normally be necessary. Thanks to Peter Masiar for this 
1381       suggestion.
1382
1383      -Two changes were made to help show structure of complex lists:
1384       (1) breakpoints are forced after every ',' in a list where any of
1385       the list items spans multiple lines, and
1386       (2) List items which span multiple lines now get continuation indentation.
1387
1388       The following example illustrates both of these points.  Many thanks to
1389       Wolfgang Weisselberg for this snippet and a discussion of it; this is a
1390       significant formatting improvement. Note how it is easier to see the call
1391       parameters in the NEW version:
1392
1393         OLD:
1394         assert( __LINE__, ( not defined $check )
1395             or ref $check
1396             or $check eq "new"
1397             or $check eq "old", "Error in parameters",
1398             defined $old_new ? ( ref $old_new ? ref $old_new : $old_new ) : "undef",
1399             defined $db_new  ? ( ref $db_new  ? ref $db_new  : $db_new )  : "undef",
1400             defined $old_db ? ( ref $old_db ? ref $old_db : $old_db ) : "undef" );
1401
1402         NEW: 
1403         assert(
1404             __LINE__,
1405             ( not defined $check )
1406               or ref $check
1407               or $check eq "new"
1408               or $check eq "old",
1409             "Error in parameters",
1410             defined $old_new ? ( ref $old_new ? ref $old_new : $old_new ) : "undef",
1411             defined $db_new  ? ( ref $db_new  ? ref $db_new  : $db_new )  : "undef",
1412             defined $old_db  ? ( ref $old_db  ? ref $old_db  : $old_db )  : "undef"
1413         );
1414
1415         Another example shows how this helps displaying lists:
1416
1417         OLD:
1418         %{ $self->{COMPONENTS} } = (
1419             fname =>
1420             { type => 'name', adj => 'yes', font => 'Helvetica', 'index' => 0 },
1421             street =>
1422             { type => 'road', adj => 'yes', font => 'Helvetica', 'index' => 2 },
1423         );
1424
1425         The structure is clearer with the added indentation:
1426         
1427     NEW:
1428         %{ $self->{COMPONENTS} } = (
1429             fname =>
1430               { type => 'name', adj => 'yes', font => 'Helvetica', 'index' => 0 },
1431             street =>
1432               { type => 'road', adj => 'yes', font => 'Helvetica', 'index' => 2 },
1433         );
1434
1435         -The structure of nested logical expressions is now displayed better.
1436         Thanks to Wolfgang Weisselberg for helpful discussions.  For example,
1437         note how the status of the final 'or' is displayed in the following:
1438
1439         OLD:
1440         return ( !null($op)
1441               and null( $op->sibling )
1442               and $op->ppaddr eq "pp_null"
1443               and class($op) eq "UNOP"
1444               and ( ( $op->first->ppaddr =~ /^pp_(and|or)$/
1445                 and $op->first->first->sibling->ppaddr eq "pp_lineseq" )
1446                 or ( $op->first->ppaddr eq "pp_lineseq"
1447                     and not null $op->first->first->sibling
1448                     and $op->first->first->sibling->ppaddr eq "pp_unstack" ) ) );
1449
1450         NEW:
1451         return (
1452             !null($op)
1453               and null( $op->sibling )
1454               and $op->ppaddr eq "pp_null"
1455               and class($op) eq "UNOP"
1456               and (
1457                 (
1458                     $op->first->ppaddr =~ /^pp_(and|or)$/
1459                     and $op->first->first->sibling->ppaddr eq "pp_lineseq"
1460                 )
1461                 or ( $op->first->ppaddr eq "pp_lineseq"
1462                     and not null $op->first->first->sibling
1463                     and $op->first->first->sibling->ppaddr eq "pp_unstack" )
1464               )
1465         );
1466
1467        -A break will always be put before a list item containing a comma-arrow.
1468        This will improve formatting of mixed lists of this form:
1469
1470             OLD:
1471             $c->create(
1472                 'text', 225, 20, -text => 'A Simple Plot',
1473                 -font => $font,
1474                 -fill => 'brown'
1475             );
1476
1477             NEW:
1478             $c->create(
1479                 'text', 225, 20,
1480                 -text => 'A Simple Plot',
1481                 -font => $font,
1482                 -fill => 'brown'
1483             );
1484
1485       -For convenience, the command -dac (--delete-all-comments) now also
1486       deletes pod.  Likewise, -tac (--tee-all-comments) now also sends pod
1487       to a '.TEE' file.  Complete control over the treatment of pod and
1488       comments is still possible, as described in the updated help message 
1489       and man page.
1490
1491       -The logic which breaks open 'containers' has been rewritten to be completely
1492       symmetric in the following sense: if a line break is placed after an opening
1493       {, [, or (, then a break will be placed before the corresponding closing
1494       token.  Thus, a container either remains closed or is completely cracked
1495       open.
1496
1497       -Improved indentation of parenthesized lists.  For example, 
1498
1499                 OLD:
1500                 $GPSCompCourse =
1501                   int(
1502                   atan2( $GPSTempCompLong - $GPSLongitude,
1503                   $GPSLatitude - $GPSTempCompLat ) * 180 / 3.14159265 );
1504
1505                 NEW:
1506                 $GPSCompCourse = int(
1507                     atan2(
1508                         $GPSTempCompLong - $GPSLongitude,
1509                         $GPSLatitude - $GPSTempCompLat
1510                       ) * 180 / 3.14159265
1511                 );
1512
1513        Further improvements will be made in future releases.
1514
1515       -Some improvements were made in formatting small lists.
1516
1517       -Correspondence between Input and Output line numbers reported in a 
1518        .LOG file should now be exact.  They were sometimes off due to the size
1519        of intermediate buffers.
1520
1521       -Corrected minor tokenization error in which a ';' in a foreach loop
1522        control was tokenized as a statement termination, which forced a 
1523        line break:
1524
1525             OLD:
1526             foreach ( $i = 0;
1527                 $i <= 10;
1528                 $i += 2
1529               )
1530             {
1531                 print "$i ";
1532             }
1533
1534             NEW:
1535             foreach ( $i = 0 ; $i <= 10 ; $i += 2 ) {
1536                 print "$i ";
1537             }
1538
1539       -Corrected a problem with reading config files, in which quote marks were not
1540        stripped.  As a result, something like -wba="&& . || " would have the leading
1541        quote attached to the && and not work correctly.  A workaround for older
1542        versions is to place a space around all tokens within the quotes, like this:
1543        -wba=" && . || "
1544
1545       -Removed any existing space between a label and its ':'
1546         OLD    : { }
1547         NEW: { }
1548        This was necessary because the label and its colon are a single token.
1549
1550       -Corrected tokenization error for the following (highly non-recommended) 
1551        construct:
1552         $user = @vars[1] / 100;
1553      
1554   -Resolved cause of a difference between perltidy under perl v5.6.1 and
1555       5.005_03; the problem was different behavior of \G regex position
1556       marker(!)
1557
1558   2001 10 20
1559      -Corrected a bug in which a break was not being made after a full-line
1560      comment within a short eval/sort/map/grep block.  A flag was not being
1561      zeroed.  The syntax error check catches this.  Here is a snippet which
1562      illustrates the bug:
1563
1564             eval {
1565                 #open Socket to Dispatcher
1566                 $sock = &OpenSocket;
1567             };
1568
1569      The formatter mistakenly thought that it had found the following 
1570      one-line block:
1571      
1572         eval {#open Socket to Dispatcher$sock = &OpenSocket; };
1573
1574      The patch fixes this. Many thanks to Henry Story for reporting this bug.
1575
1576      -Changes were made to help diagnose and resolve problems in a
1577      .perltidyrc file: 
1578        (1) processing of command parameters has been into two separate
1579        batches so that any errors in a .perltidyrc file can be localized.  
1580        (2) commands --help, --version, and as many of the --dump-xxx
1581        commands are handled immediately, without any command line processing
1582        at all.  
1583        (3) Perltidy will ignore any commands in the .perltidyrc file which
1584        cause immediate exit.  These are:  -h -v -ddf -dln -dop -dsn -dtt
1585        -dwls -dwrs -ss.  Thanks to Wolfgang Weisselberg for helpful
1586        suggestions regarding these updates.
1587
1588      -Syntax check has been reinstated as default for MSWin32 systems.  This
1589      way Windows 2000 users will get syntax check by default, which seems
1590      like a better idea, since the number of Win 95/98 systems will be
1591      decreasing over time.  Documentation revised to warn Windows 95/98
1592      users about the problem with empty '&1'.  Too bad these systems
1593      all report themselves as MSWin32.
1594
1595   2001 10 16
1596      -Fixed tokenization error in which a method call of the form
1597
1598         Module::->new();
1599      
1600   got a space before the '::' like this:
1601
1602         Module ::->new();
1603
1604       Thanks to David Holden for reporting this.
1605      
1606  -Added -html control over pod text, using a new abbreviation 'pd'.  See
1607      updated perl2web man page. The default is to use the color of a comment,
1608      but italicized.  Old .css style sheets will need a new line for
1609      .pd to use this.  The old color was the color of a string, and there
1610      was no control.  
1611      
1612  -.css lines are now printed in sorted order.
1613
1614      -Fixed interpolation problem where html files had '$input_file' as title
1615      instead of actual input file name.  Thanks to Simon Perreault for finding
1616      this and sending a patch, and also to Tobias Weber.
1617
1618      -Breaks will now have the ':' placed at the start of a line, 
1619      one per line by default because this shows logical structure
1620      more clearly. This coding has been completely redone. Some 
1621      examples of new ?/: formatting:
1622
1623            OLD:
1624                 wantarray ? map( $dir::cwd->lookup($_)->path, @_ ) :
1625                   $dir::cwd->lookup( $_[0] )->path;
1626
1627            NEW:
1628                 wantarray 
1629                   ? map( $dir::cwd->lookup($_)->path, @_ )
1630                   : $dir::cwd->lookup( $_[0] )->path;
1631
1632            OLD:
1633                     $a = ( $b > 0 ) ? {
1634                         a => 1,
1635                         b => 2
1636                     } : { a => 6, b => 8 };
1637
1638            NEW:
1639                     $a = ( $b > 0 )
1640                       ? {
1641                         a => 1,
1642                         b => 2
1643                       }
1644                       : { a => 6, b => 8 };
1645
1646         OLD: (-gnu):
1647         $self->note($self->{skip} ? "Hunk #$self->{hunk} ignored at 1.\n" :
1648                     "Hunk #$self->{hunk} failed--$@");
1649
1650         NEW: (-gnu):
1651         $self->note($self->{skip} 
1652                     ? "Hunk #$self->{hunk} ignored at 1.\n"
1653                     : "Hunk #$self->{hunk} failed--$@");
1654
1655         OLD:
1656             $which_search =
1657               $opts{"t"} ? 'title'   :
1658               $opts{"s"} ? 'subject' : $opts{"a"} ? 'author' : 'title';
1659
1660         NEW:
1661             $which_search =
1662               $opts{"t"} ? 'title'
1663               : $opts{"s"} ? 'subject'
1664               : $opts{"a"} ? 'author'
1665               : 'title';
1666      
1667  You can use -wba=':' to recover the previous default which placed ':'
1668      at the end of a line.  Thanks to Michael Cartmell for helpful
1669      discussions and examples.  
1670
1671      -Tokenizer updated to do syntax checking for matched ?/: pairs.  Also,
1672      the tokenizer now outputs a unique serial number for every balanced
1673      pair of brace types and ?/: pairs.  This greatly simplifies the
1674      formatter.
1675
1676      -Long lines with repeated 'and', 'or', '&&', '||'  will now have
1677      one such item per line.  For example:
1678
1679         OLD:
1680             if ( $opt_d || $opt_m || $opt_p || $opt_t || $opt_x
1681                 || ( -e $archive && $opt_r ) )
1682             {
1683                 ( $pAr, $pNames ) = readAr($archive);
1684             }
1685
1686         NEW:
1687             if ( $opt_d
1688                 || $opt_m
1689                 || $opt_p
1690                 || $opt_t
1691                 || $opt_x
1692                 || ( -e $archive && $opt_r ) )
1693             {
1694                 ( $pAr, $pNames ) = readAr($archive);
1695             }
1696
1697        OLD:
1698             if ( $vp->{X0} + 4 <= $x && $vp->{X0} + $vp->{W} - 4 >= $x
1699                 && $vp->{Y0} + 4 <= $y && $vp->{Y0} + $vp->{H} - 4 >= $y ) 
1700
1701        NEW:
1702             if ( $vp->{X0} + 4 <= $x
1703                 && $vp->{X0} + $vp->{W} - 4 >= $x
1704                 && $vp->{Y0} + 4 <= $y
1705                 && $vp->{Y0} + $vp->{H} - 4 >= $y )
1706
1707      -Long lines with multiple concatenated tokens will have concatenated
1708      terms (see below) placed one per line, except for short items.  For
1709      example:
1710
1711        OLD:
1712             $report .=
1713               "Device type:" . $ib->family . "  ID:" . $ib->serial . "  CRC:"
1714               . $ib->crc . ": " . $ib->model() . "\n";
1715
1716        NEW:
1717             $report .= "Device type:"
1718               . $ib->family . "  ID:"
1719               . $ib->serial . "  CRC:"
1720               . $ib->model()
1721               . $ib->crc . ": " . "\n";
1722
1723      NOTE: at present 'short' means 8 characters or less.  There is a
1724      tentative flag to change this (-scl), but it is undocumented and
1725      is likely to be changed or removed later, so only use it for testing.  
1726      In the above example, the tokens "  ID:", "  CRC:", and "\n" are below
1727      this limit.  
1728
1729      -If a line which is short enough to fit on a single line was
1730      nevertheless broken in the input file at a 'good' location (see below), 
1731      perltidy will try to retain a break.  For example, the following line
1732      will be formatted as:
1733      
1734     open SUM, "<$file"
1735           or die "Cannot open $file ($!)";
1736      
1737  if it was broken in the input file, and like this if not:
1738
1739         open SUM, "<$file" or die "Cannot open $file ($!)";
1740
1741      GOOD: 'good' location means before 'and','or','if','unless','&&','||'
1742
1743      The reason perltidy does not just always break at these points is that if
1744      there are multiple, similar statements, this would preclude alignment.  So
1745      rather than check for this, perltidy just tries to follow the input style,
1746      in the hopes that the author made a good choice. Here is an example where 
1747      we might not want to break before each 'if':
1748
1749         ($Locale, @Locale) = ($English, @English) if (@English > @Locale);
1750         ($Locale, @Locale) = ($German,  @German)  if (@German > @Locale);
1751         ($Locale, @Locale) = ($French,  @French)  if (@French > @Locale);
1752         ($Locale, @Locale) = ($Spanish, @Spanish) if (@Spanish > @Locale);
1753
1754      -Added wildcard file expansion for systems with shells which lack this.
1755      Now 'perltidy *.pl' should work under MSDOS/Windows.  Thanks to Hugh Myers 
1756      for suggesting this.  This uses builtin glob() for now; I may change that.
1757
1758      -Added new flag -sbl which, if specified, overrides the value of -bl
1759      for opening sub braces.  This allows formatting of this type:
1760
1761      perltidy -sbl 
1762
1763      sub foo
1764      {
1765         if (!defined($_[0])) {
1766             print("Hello, World\n");
1767         }
1768         else {
1769             print($_[0], "\n");
1770         }
1771      }
1772      Requested by Don Alexander.
1773
1774      -Fixed minor parsing error which prevented a space after a $$ variable
1775      (pid) in some cases.  Thanks to Michael Cartmell for noting this.
1776      For example, 
1777        old: $$< 700 
1778        new: $$ < 700
1779
1780      -Improved line break choices 'and' and 'or' to display logic better.
1781      For example:
1782
1783         OLD:
1784             exists $self->{'build_dir'} and push @e,
1785               "Unwrapped into directory $self->{'build_dir'}";
1786
1787         NEW:
1788             exists $self->{'build_dir'}
1789               and push @e, "Unwrapped into directory $self->{'build_dir'}";
1790
1791      -Fixed error of multiple use of abbreviatioin '-dsc'.  -dsc remains 
1792      abbreviation for delete-side-comments; -dsm is new abbreviation for 
1793      delete-semicolons.
1794
1795      -Corrected and updated 'usage' help routine.  Thanks to Slaven Rezic for 
1796      noting an error.
1797
1798      -The default for Windows is, for now, not to do a 'perl -c' syntax
1799      check (but -syn will activate it).  This is because of problems with
1800      command.com.  James Freeman sent me a patch which tries to get around
1801      the problems, and it works in many cases, but testing revealed several
1802      issues that still need to be resolved.  So for now, the default is no
1803      syntax check for Windows.
1804
1805      -I added a -T flag when doing perl -c syntax check.
1806      This is because I test it on a large number of scripts from sources
1807      unknown, and who knows what might be hidden in initialization blocks?
1808      Also, deactivated the syntax check if perltidy is run as root.  As a
1809      benign example, running the previous version of perltidy on the
1810      following file would cause it to disappear:
1811
1812             BEGIN{
1813                     print "Bye, bye baby!\n";
1814                     unlink $0;
1815             }
1816             
1817  The new version will not let that happen.
1818
1819      -I am contemplating (but have not yet implemented) making '-lp' the
1820      default indentation, because it is stable now and may be closer to how
1821      perl is commonly formatted.  This could be in the next release.  The
1822      reason that '-lp' was not the original default is that the coding for
1823      it was complex and not ready for the initial release of perltidy.  If
1824      anyone has any strong feelings about this, I'd like to hear.  The
1825      current default could always be recovered with the '-nlp' flag.
1826
1827   2001 09 03
1828      -html updates:
1829          - sub definition names are now specially colored, red by default.  
1830            The letter 'm' is used to identify them.
1831          - keyword 'sub' now has color of other keywords.
1832          - restored html keyword color to __END__ and __DATA__, which was 
1833            accidentally removed in the previous version.
1834
1835      -A new -se (--standard-error-output) flag has been implemented and
1836      documented which causes all errors to be written to standard output
1837      instead of a .ERR file.
1838
1839      -A new -w (--warning-output) flag has been implemented and documented
1840       which causes perltidy to output certain non-critical messages to the
1841       error output file, .ERR.  These include complaints about pod usage,
1842       for example.  The default is to not include these.
1843
1844       NOTE: This replaces an undocumented -w=0 or --warning-level flag
1845       which was tentatively introduced in the previous version to avoid some
1846       unwanted messages.  The new default is the same as the old -w=0, so
1847       that is no longer needed. 
1848
1849       -Improved syntax checking and corrected tokenization of functions such
1850       as rand, srand, sqrt, ...  These can accept either an operator or a term
1851       to their right.  This has been corrected.
1852      
1853  -Corrected tokenization of semicolon: testing of the previous update showed 
1854      that the semicolon in the following statement was being mis-tokenized.  That
1855      did no harm, other than adding an extra blank space, but has been corrected.
1856
1857               for (sort {strcoll($a,$b);} keys %investments) {
1858                  ...
1859               }
1860
1861      -New syntax check: after wasting 5 minutes trying to resolve a syntax
1862       error in which I had an extra terminal ';' in a complex for (;;) statement, 
1863       I spent a few more minutes adding a check for this in perltidy so it won't
1864       happen again.
1865
1866      -The behavior of --break-before-subs (-bbs) and --break-before-blocks
1867      (-bbb) has been modified.  Also, a new control parameter,
1868      --long-block-line-count=n (-lbl=n) has been introduced to give more
1869      control on -bbb.  This was previously a hardwired value.  The reason
1870      for the change is to reduce the number of unwanted blank lines that
1871      perltidy introduces, and make it less erratic.  It's annoying to remove
1872      an unwanted blank line and have perltidy put it back.  The goal is to
1873      be able to sprinkle a few blank lines in that dense script you
1874      inherited from Bubba.  I did a lot of experimenting with different
1875      schemes for introducing blank lines before and after code blocks, and
1876      decided that there is no really good way to do it.  But I think the new
1877      scheme is an improvement.  You can always deactivate this with -nbbb.
1878      I've been meaning to work on this; thanks to Erik Thaysen for bringing
1879      it to my attention.
1880
1881      -The .LOG file is seldom needed, and I get tired of deleting them, so
1882       they will now only be automatically saved if perltidy thinks that it
1883       made an error, which is almost never.  You can still force the logfile
1884       to be saved with -log or -g.
1885
1886      -Improved method for computing number of columns in a table.  The old
1887      method always tried for an even number.  The new method allows odd
1888      numbers when it is obvious that a list is not a hash initialization
1889      list.
1890
1891        old: my (
1892                  $name,       $xsargs, $parobjs, $optypes,
1893                  $hasp2child, $pmcode, $hdrcode, $inplacecode,
1894                  $globalnew,  $callcopy
1895               )
1896               = @_;
1897
1898        new: my (
1899                  $name,   $xsargs,  $parobjs,     $optypes,   $hasp2child,
1900                  $pmcode, $hdrcode, $inplacecode, $globalnew, $callcopy
1901               )
1902               = @_;
1903
1904      -I fiddled with the list threshold adjustment, and some small lists
1905      look better now.  Here is the change for one of the lists in test file
1906      'sparse.t':
1907      old:
1908        %units =
1909          ("in", "in", "pt", "pt", "pc", "pi", "mm", "mm", "cm", "cm", "\\hsize", "%",
1910            "\\vsize", "%", "\\textwidth", "%", "\\textheight", "%");
1911
1912      new:
1913        %units = (
1914                   "in",      "in", "pt",          "pt", "pc",           "pi",
1915                   "mm",      "mm", "cm",          "cm", "\\hsize",      "%",
1916                   "\\vsize", "%",  "\\textwidth", "%",  "\\textheight", "%"
1917                   );
1918
1919      -Improved -lp formatting at '=' sign.  A break was always being added after
1920      the '=' sign in a statement such as this, (to be sure there was enough room
1921      for the parameters):
1922
1923      old: my $fee =
1924             CalcReserveFee(
1925                             $env,          $borrnum,
1926                             $biblionumber, $constraint,
1927                             $bibitems
1928                             );
1929      
1930  The updated version doesn't do this unless the space is really needed:
1931
1932      new: my $fee = CalcReserveFee(
1933                                    $env,          $borrnum,
1934                                    $biblionumber, $constraint,
1935                                    $bibitems
1936                                    );
1937
1938      -I updated the tokenizer to allow $#+ and $#-, which seem to be new to
1939      Perl 5.6.  Some experimenting with a recent version of Perl indicated
1940      that it allows these non-alphanumeric '$#' array maximum index
1941      varaibles: $#: $#- $#+ so I updated the parser accordingly.  Only $#:
1942      seems to be valid in older versions of Perl.
1943
1944      -Fixed a rare formatting problem with -lp (and -gnu) which caused
1945      excessive indentation.
1946
1947      -Many additional syntax checks have been added.
1948
1949      -Revised method for testing here-doc target strings; the following
1950      was causing trouble with a regex test because of the '*' characters:
1951       print <<"*EOF*";
1952       bla bla
1953       *EOF*
1954      Perl seems to allow almost anything to be a here doc target, so an
1955      exact string comparison is now used.
1956
1957      -Made update to allow underscores in binary numbers, like '0b1100_0000'.
1958
1959      -Corrected problem with scanning certain module names; a blank space was 
1960      being inserted after 'warnings' in the following:
1961         use warnings::register;
1962      The problem was that warnings (and a couple of other key modules) were 
1963      being tokenized as keywords.  They should have just been identifiers.
1964
1965      -Corrected tokenization of indirect objects after sort, system, and exec,
1966      after testing produced an incorrect error message for the following
1967      line of code:
1968         print sort $sortsubref @list;
1969
1970      -Corrected minor problem where a line after a format had unwanted
1971      extra continuation indentation.  
1972
1973      -Delete-block-comments (and -dac) now retain any leading hash-bang line
1974
1975      -Update for -lp (and -gnu) to not align the leading '=' of a list
1976      with a previous '=', since this interferes with alignment of parameters.
1977
1978       old:  my $hireDay = new Date;
1979             my $self    = {
1980                          firstName => undef,
1981                          lastName  => undef,
1982                          hireDay   => $hireDay
1983                          };
1984         
1985   new:  my $hireDay = new Date;
1986             my $self = {
1987                          firstName => undef,
1988                          lastName  => undef,
1989                          hireDay   => $hireDay
1990                          };
1991
1992      -Modifications made to display tables more compactly when possible,
1993       without adding lines. For example,
1994       old:
1995                     '1', "I", '2', "II", '3', "III", '4', "IV",
1996                     '5', "V", '6', "VI", '7', "VII", '8', "VIII",
1997                     '9', "IX"
1998       new:
1999                     '1', "I",   '2', "II",   '3', "III",
2000                     '4', "IV",  '5', "V",    '6', "VI",
2001                     '7', "VII", '8', "VIII", '9', "IX"
2002
2003      -Corrected minor bug in which -pt=2 did not keep the right paren tight
2004      around a '++' or '--' token, like this:
2005
2006                 for ($i = 0 ; $i < length $key ; $i++ )
2007
2008      The formatting for this should be, and now is: 
2009
2010                 for ($i = 0 ; $i < length $key ; $i++)
2011
2012      Thanks to Erik Thaysen for noting this.
2013
2014      -Discovered a new bug involving here-docs during testing!  See BUGS.html.  
2015
2016      -Finally fixed parsing of subroutine attributes (A Perl 5.6 feature).
2017      However, the attributes and prototypes must still be on the same line
2018      as the sub name.
2019
2020   2001 07 31
2021      -Corrected minor, uncommon bug found during routine testing, in which a
2022      blank got inserted between a function name and its opening paren after
2023      a file test operator, but only in the case that the function had not
2024      been previously seen.  Perl uses the existance (or lack thereof) of 
2025      the blank to guess if it is a function call.  That is,
2026         if (-l pid_filename()) {
2027      became
2028         if (-l pid_filename ()) {
2029      which is a syntax error if pid_filename has not been seen by perl.
2030
2031      -If the AutoLoader module is used, perltidy will continue formatting
2032      code after seeing an __END__ line.  Use -nlal to deactivate this feature.  
2033      Likewise, if the SelfLoader module is used, perltidy will continue 
2034      formatting code after seeing a __DATA__ line.  Use -nlsl to
2035      deactivate this feature.  Thanks to Slaven Rezic for this suggestion.
2036
2037      -pod text after __END__ and __DATA__ is now identified by perltidy
2038      so that -dp works correctly.  Thanks to Slaven Rezic for this suggestion.
2039
2040      -The first $VERSION line which might be eval'd by MakeMaker
2041      is now passed through unchanged.  Use -npvl to deactivate this feature.
2042      Thanks to Manfred Winter for this suggestion.
2043
2044      -Improved indentation of nested parenthesized expressions.  Tests have
2045      given favorable results.  Thanks to Wolfgang Weisselberg for helpful
2046      examples.
2047
2048   2001 07 23
2049      -Fixed a very rare problem in which an unwanted semicolon was inserted
2050      due to misidentification of anonymous hash reference curly as a code
2051      block curly.  (No instances of this have been reported; I discovered it
2052      during testing).  A workaround for older versions of perltidy is to use
2053      -nasc.
2054
2055      -Added -icb (-indent-closing-brace) parameter to indent a brace which
2056      terminates a code block to the same level as the previous line.
2057      Suggested by Andrew Cutler.  For example, 
2058
2059             if ($task) {
2060                 yyy();
2061                 }    # -icb
2062             else {
2063                 zzz();
2064                 }
2065
2066      -Rewrote error message triggered by an unknown bareword in a print or
2067      printf filehandle position, and added flag -w=0 to prevent issuing this
2068      error message.  Suggested by Byron Jones.
2069
2070      -Added modification to align a one-line 'if' block with similar
2071      following 'elsif' one-line blocks, like this:
2072           if    ( $something eq "simple" )  { &handle_simple }
2073           elsif ( $something eq "hard" )    { &handle_hard }
2074      (Suggested by  Wolfgang Weisselberg).
2075
2076   2001 07 02
2077      -Eliminated all constants with leading underscores because perl 5.005_03
2078      does not support that.  For example, _SPACES changed to XX_SPACES.
2079      Thanks to kromJx for this update.
2080
2081   2001 07 01
2082      -the directory of test files has been moved to a separate distribution
2083      file because it is getting large but is of little interest to most users.
2084      For the current distribution:
2085        perltidy-20010701.tgz        contains the source and docs for perltidy
2086        perltidy-20010701-test.tgz   contains the test files
2087
2088      -fixed bug where temporary file perltidy.TMPI was not being deleted 
2089      when input was from stdin.
2090
2091      -adjusted line break logic to not break after closing brace of an
2092      eval block (suggested by Boris Zentner).
2093
2094      -added flag -gnu (--gnu-style) to give an approximation to the GNU
2095      style as sometimes applied to perl.  The programming style in GNU
2096      'automake' was used as a guide in setting the parameters; these
2097      parameters will probably be adjusted over time.
2098
2099      -an empty code block now has one space for emphasis:
2100        if ( $cmd eq "bg_untested" ) {}    # old
2101        if ( $cmd eq "bg_untested" ) { }   # new
2102      If this bothers anyone, we could create a parameter.
2103
2104      -the -bt (--brace-tightness) parameter has been split into two
2105      parameters to give more control. -bt now applies only to non-BLOCK
2106      braces, while a new parameter -bbt (block-brace-tightness) applies to
2107      curly braces which contain code BLOCKS. The default value is -bbt=0.
2108
2109      -added flag -icp (--indent-closing-paren) which leaves a statment
2110      termination of the form );, };, or ]; indented with the same
2111      indentation as the previous line.  For example,
2112
2113         @month_of_year = (          # default, or -nicp
2114             'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct',
2115             'Nov', 'Dec'
2116         );
2117
2118         @month_of_year = (          # -icp
2119             'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct',
2120             'Nov', 'Dec'
2121             );
2122
2123      -Vertical alignment updated to synchronize with tokens &&, ||,
2124      and, or, if, unless.  Allowable space before forcing
2125      resynchronization has been increased.  (Suggested by  Wolfgang
2126      Weisselberg).
2127
2128      -html corrected to use -nohtml-bold-xxxxxxx or -nhbx to negate bold,
2129      and likewise -nohtml-italic-xxxxxxx or -nhbi to negate italic.  There
2130      was no way to negate these previously.  html documentation updated and
2131      corrected.  (Suggested by  Wolfgang Weisselberg).
2132
2133      -Some modifications have been made which improve the -lp formatting in
2134      a few cases.
2135
2136      -Perltidy now retains or creates a blank line after an =cut to keep
2137      podchecker happy (Suggested by Manfred H. Winter).  This appears to be
2138      a glitch in podchecker, but it was annoying.
2139
2140   2001 06 17
2141      -Added -bli flag to give continuation indentation to braces, like this
2142
2143             if ($bli_flag)
2144               {
2145                 extra_indentation();
2146               }
2147
2148      -Corrected an error with the tab (-t) option which caused the last line
2149      of a multi-line quote to receive a leading tab.  This error was in
2150      version 2001 06 08  but not 2001 04 06.  If you formatted a script
2151      with -t with this version, please check it by running once with the
2152      -chk flag and perltidy will scan for this possible error.
2153
2154      -Corrected an invalid pattern (\R should have been just R), changed
2155      $^W =1 to BEGIN {$^W=1} to use warnings in compile phase, and corrected
2156      several unnecessary 'my' declarations. Many thanks to Wolfgang Weisselberg,
2157      2001-06-12, for catching these errors.
2158      
2159  -A '-bar' flag has been added to require braces to always be on the
2160      right, even for multi-line if and foreach statements.  For example,
2161      the default formatting of a long if statement would be:
2162
2163             if ($bigwasteofspace1 && $bigwasteofspace2
2164               || $bigwasteofspace3 && $bigwasteofspace4)
2165             {
2166                 bigwastoftime();
2167             }
2168
2169      With -bar, the formatting is:
2170
2171             if ($bigwasteofspace1 && $bigwasteofspace2
2172               || $bigwasteofspace3 && $bigwasteofspace4) {
2173                 bigwastoftime();
2174             }
2175      Suggested by Eli Fidler 2001-06-11.
2176
2177      -Uploaded perltidy to sourceforge cvs 2001-06-10.
2178
2179      -An '-lp' flag (--line-up-parentheses) has been added which causes lists
2180      to be indented with extra indentation in the manner sometimes
2181      associated with emacs or the GNU suggestions.  Thanks to Ian Stuart for
2182      this suggestion and for extensive help in testing it. 
2183
2184      -Subroutine call parameter lists are now formatted as other lists.
2185      This should improve formatting of tables being passed via subroutine
2186      calls.  This will also cause full indentation ('-i=n, default n= 4) of
2187      continued parameter list lines rather than just the number of spaces
2188      given with -ci=n, default n=2.
2189      
2190  -Added support for hanging side comments.  Perltidy identifies a hanging
2191      side comment as a comment immediately following a line with a side
2192      comment or another hanging side comment.  This should work in most
2193      cases.  It can be deactivated with --no-hanging-side-comments (-nhsc).
2194      The manual has been updated to discuss this.  Suggested by Brad
2195      Eisenberg some time ago, and finally implemented.
2196
2197   2001 06 08
2198      -fixed problem with parsing command parameters containing quoted
2199      strings in .perltidyrc files. (Reported by Roger Espel Llima 2001-06-07).
2200
2201      -added two command line flags, --want-break-after and 
2202      --want-break-before, which allow changing whether perltidy
2203      breaks lines before or after any operators.  Please see the revised 
2204      man pages for details.
2205
2206      -added system-wide configuration file capability.
2207      If perltidy does not find a .perltidyrc command line file in
2208      the current directory, nor in the home directory, it now looks
2209      for '/usr/local/etc/perltidyrc' and then for '/etc/perltidyrc'.
2210      (Suggested by Roger Espel Llima 2001-05-31).
2211
2212      -fixed problem in which spaces were trimmed from lines of a multi-line
2213      quote. (Reported by Roger Espel Llima 2001-05-30).  This is an 
2214      uncommon situation, but serious, because it could conceivably change
2215      the proper function of a script.
2216
2217      -fixed problem in which a semicolon was incorrectly added within 
2218      an anonymous hash.  (Reported by A.C. Yardley, 2001-5-23).
2219      (You would know if this happened, because perl would give a syntax
2220      error for the resulting script).
2221
2222      -fixed problem in which an incorrect error message was produced
2223       after a version number on a 'use' line, like this ( Reported 
2224       by Andres Kroonmaa, 2001-5-14):
2225
2226                   use CGI 2.42 qw(fatalsToBrowser);
2227
2228       Other than the extraneous error message, this bug was harmless.
2229
2230   2001 04 06
2231      -fixed serious bug in which the last line of some multi-line quotes or
2232       patterns was given continuation indentation spaces.  This may make
2233       a pattern incorrect unless it uses the /x modifier.  To find
2234       instances of this error in scripts which have been formatted with
2235       earlier versions of perltidy, run with the -chk flag, which has
2236       been added for this purpose (SLH, 2001-04-05).
2237
2238       ** So, please check previously formatted scripts by running with -chk
2239       at least once **
2240
2241      -continuation indentation has been reprogrammed to be hierarchical, 
2242       which improves deeply nested structures.
2243
2244      -fixed problem with undefined value in list formatting (reported by Michael
2245       Langner 2001-04-05)
2246
2247      -Switched to graphical display of nesting in .LOG files.  If an
2248       old format string was "(1 [0 {2", the new string is "{{(".  This
2249       is easier to read and also shows the order of nesting.
2250
2251      -added outdenting of cuddled paren structures, like  ")->pack(".
2252
2253      -added line break and outdenting of ')->' so that instead of
2254
2255             $mw->Label(
2256               -text   => "perltidy",
2257               -relief => 'ridge')->pack;
2258      
2259   the current default is:
2260
2261             $mw->Label(
2262               -text   => "perltidy",
2263               -relief => 'ridge'
2264             )->pack;
2265
2266       (requested by Michael Langner 2001-03-31; in the future this could 
2267       be controlled by a command-line parameter).
2268
2269      -revised list indentation logic, so that lists following an assignment
2270       operator get one full indentation level, rather than just continuation 
2271       indentation.  Also corrected some minor glitches in the continuation 
2272       indentation logic. 
2273
2274      -Fixed problem with unwanted continuation indentation after a blank line 
2275      (reported by Erik Thaysen 2001-03-28):
2276
2277      -minor update to avoid stranding a single '(' on one line
2278
2279   2001 03 28:
2280      -corrected serious error tokenizing filehandles, in which a sub call 
2281      after a print or printf, like this:
2282         print usage() and exit;
2283      became this:
2284         print usage () and exit;
2285      Unfortunately, this converts 'usage' to a filehandle.  To fix this, rerun
2286      perltidy; it will look for this situation and issue a warning. 
2287
2288      -fixed another cuddled-else formatting bug (Reported by Craig Bourne)
2289
2290      -added several diagnostic --dump routines
2291      
2292  -added token-level whitespace controls (suggested by Hans Ecke)
2293
2294   2001 03 23:
2295      -added support for special variables of the form ${^WANT_BITS}
2296
2297      -space added between scalar and left paren in 'for' and 'foreach' loops,
2298       (suggestion by Michael Cartmell):
2299
2300         for $i( 1 .. 20 )   # old
2301         for $i ( 1 .. 20 )   # new
2302
2303      -html now outputs cascading style sheets (thanks to suggestion from
2304       Hans Ecke)
2305
2306      -flags -o and -st now work with -html
2307
2308      -added missing -html documentation for comments (noted by Alex Izvorski)
2309
2310      -support for VMS added (thanks to Michael Cartmell for code patches and 
2311        testing)
2312
2313      -v-strings implemented (noted by Hans Ecke and Michael Cartmell; extensive
2314        testing by Michael Cartmell)
2315
2316      -fixed problem where operand may be empty at line 3970 
2317       (\b should be just b in lines 3970, 3973) (Thanks to Erik Thaysen, 
2318       Keith Marshall for bug reports)
2319
2320      -fixed -ce bug (cuddled else), where lines like '} else {' were indented
2321       (Thanks to Shawn Stepper and Rick Measham for reporting this)
2322
2323   2001 03 04:
2324      -fixed undefined value in line 153 (only worked with -I set)
2325      (Thanks to Mike Stok, Phantom of the Opcodes, Ian Ehrenwald, and others)
2326
2327      -fixed undefined value in line 1069 (filehandle problem with perl versions <
2328      5.6) (Thanks to Yuri Leikind, Mike Stok, Michael Holve, Jeff Kolber)
2329
2330   2001 03 03:
2331      -Initial announcement at freshmeat.net; started Change Log
2332      (Unfortunately this version was DOA, but it was fixed the next day)
2333