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