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