]> git.donarmstrong.com Git - perltidy.git/blob - docs/ChangeLog.html
New upstream version 20190601
[perltidy.git] / docs / ChangeLog.html
1 <h1>Perltidy Change Log</h1>
2
3 <h2>2019 06 01</h2>
4
5 <pre><code>- rt #128477: Prevent inconsistent owner/group and setuid/setgid bits. 
6   In the -b (--backup-and-modify-in-place) mode, an attempt is made to set ownership
7   of the output file equal to the input file, if they differ.
8   In all cases, if the final output file ownership differs from input file, any setuid/setgid bits are cleared.
9
10 - Added option -bom  (--break-at-old-method-breakpoints) by
11   merrillymeredith which preserves breakpoints of method chains. Modified to also handle a cuddled call style.
12
13 - Merged patch to fix Windows EOL translation error with UTF-8 written by
14   Ron Ivy. This update prevents automatic conversion to 'DOS' CRLF line
15   endings.  Also, Windows system testing at the appveyor site is working again.
16
17 - RT #128280, added flag --one-line-block-semicolons=n (-olbs=n) 
18   to control semicolons in one-line blocks.  The values of n are:
19     n=0 means no semicolons termininating simple one-line blocks
20     n=1 means stable; do not change from input file [DEFAULT and current]
21     n=2 means always add semicolons in one-line blocks
22   The current behavior corresponds to the default n=1.
23
24 - RT #128216, Minor update to prevent inserting unwanted blank line at
25   indentation level change.  This should not change existing scripts.
26
27 - RT #81852: Improved indentation when quoted word (qw) lists are 
28   nested within other containers using the --weld-nested (-wn) flag.
29   The example given previously (below) is now closer to what it would
30   be with a simple list instead of qw:
31
32   # perltidy -wn
33   use_all_ok( qw{
34       PPI
35       PPI::Tokenizer
36       PPI::Lexer
37       PPI::Dumper
38       PPI::Find
39       PPI::Normal
40       PPI::Util
41       PPI::Cache
42   } );
43
44 - RT#12764, introduced new feature allowing placement of blanks around
45   sequences of selected keywords. This can be activated with the -kgb* 
46   series of parameters described in the manual.
47
48 - Rewrote vertical algnment module.  It is better at finding
49   patterns in complex code. For example,
50
51 OLD:
52        /^-std$/ &amp;&amp; do { $std       = 1;     next; };
53        /^--$/   &amp;&amp; do { @link_args = @argv; last; };
54        /^-I(.*)/ &amp;&amp; do { $path = $1 || shift @argv; next; };
55
56 NEW:
57        /^-std$/  &amp;&amp; do { $std       = 1;                 next; };
58        /^--$/    &amp;&amp; do { @link_args = @argv;             last; };
59        /^-I(.*)/ &amp;&amp; do { $path      = $1 || shift @argv; next; };
60
61 - Add repository URLs to META files 
62
63 - RT #118553, "leave only one newline at end of file". This option was not 
64   added because of undesirable side effects, but a new filter script
65   was added which can do this, "examples/delete_ending_blank_lines.pl".
66 </code></pre>
67
68 <h2>2018 11 20</h2>
69
70 <pre><code>- fix RT#127736 Perl-Tidy-20181119 has the EXE_FILES entry commented out in
71   Makefile.PL so it doesn't install the perltidy script or its manpage.
72 </code></pre>
73
74 <h2>2018 11 19</h2>
75
76 <pre><code>- Removed test case 'filter_example.t' which was causing a failure on a
77   Windows installation for unknown reasons, possibly due to an unexpected
78   perltidyrc being read by the test script.  Added VERSION numbers to all
79   new modules.
80 </code></pre>
81
82 <h2>2018 11 17</h2>
83
84 <pre><code>- Fixed RT #126965, in which a ternary operator was misparsed if immediately
85   following a function call without arguments, such as: 
86     my $restrict_customer = shift ? 1 : 0;
87
88 - Fixed RT #125012: bug in -mangle --delete-all-comments
89   A needed blank space before bareword tokens was being removed when comments 
90   were deleted
91
92 - Fixed RT #81852: Stacked containers and quoting operators. Quoted words
93   (qw) delimited by container tokens ('{', '[', '(', '&lt;') are now included in
94   the --weld-nested (-wn) flag:
95
96       # perltidy -wn
97       use_all_ok( qw{
98             PPI
99             PPI::Tokenizer
100             PPI::Lexer
101             PPI::Dumper
102             PPI::Find
103             PPI::Normal
104             PPI::Util
105             PPI::Cache
106             } );
107
108 - The cuddled-else (-ce) coding was merged with the new cuddled-block (-cb)
109   coding.  The change is backward compatible and simplifies input.  
110   The --cuddled-block-option=n (-cbo=n) flag now applies to both -ce and -cb 
111   formatting.  In fact the -cb flag is just an alias for -ce now.
112
113 - Fixed RT #124594, license text desc. changed from 'GPL-2.0+' to 'gpl_2'
114
115 - Fixed bug in which a warning about a possible code bug was issued in a
116   script with brace errors. 
117
118 - added option --notimestamp or -nts to eliminate any time stamps in output 
119   files.  This is used to prevent differences in test scripts from causing
120   failure at installation. For example, the -cscw option will put a date
121   stamp on certain closing side comments. We need to avoid this in order
122   to test this feature in an installation test.
123
124 - Fixed bug with the entab option, -et=8, in which the leading space of
125   some lines was was not entabbed.  This happened in code which was adjusted
126   for vertical alignment and in hanging side comments. Thanks to Glenn.
127
128 - Fixed RT #127633, undesirable line break after return when -baao flag is set
129
130 - Fixed RT #127035, vertical alignment. Vertical alignment has been improved 
131   in several ways.  Thanks especially to Michael Wardman and Glenn for sending 
132   helpful snippets. 
133
134   - Alignment of the =~ operators has been reactivated.  
135
136       OLD:
137       $service_profile =~ s/^\s+|\s+$//g;
138       $host_profile =~ s/^\s+|\s+$//g;
139
140       NEW:
141       $service_profile =~ s/^\s+|\s+$//g;
142       $host_profile    =~ s/^\s+|\s+$//g;
143
144   - Alignment of the // operator has been reactivated.  
145
146       OLD:
147       is( pop // 7,       7, 'pop // ... works' );
148       is( pop() // 7,     0, 'pop() // ... works' );
149       is( pop @ARGV // 7, 3, 'pop @array // ... works' );
150
151       NEW:
152       is( pop       // 7, 7, 'pop // ... works' );
153       is( pop()     // 7, 0, 'pop() // ... works' );
154       is( pop @ARGV // 7, 3, 'pop @array // ... works' );
155
156   - The rules for alignment of just two lines have been adjusted,
157     hopefully to be a little better overall.  In some cases, two 
158     lines which were previously unaligned are now aligned, and vice-versa.
159
160       OLD:
161       $expect = "1$expect" if $expect =~ /^e/i;
162       $p = "1$p" if defined $p and $p =~ /^e/i;
163
164       NEW:
165       $expect = "1$expect" if $expect =~ /^e/i;
166       $p      = "1$p"      if defined $p and $p =~ /^e/i;
167
168
169 - RT #106493; source code repository location has been added to docs; it is 
170      https://github.com/perltidy/perltidy
171
172 - The packaging for this version has changed. The Tidy.pm module is much 
173   smaller.  Supporting modules have been split out from it and placed below 
174   it in the path Perl/Tidy/*.
175
176 - A number of new installation test cases have been added. Updates are now
177   continuously tested at Travis CI against versions back to Perl 5.08.
178 </code></pre>
179
180 <h2>2018 02 20</h2>
181
182 <pre><code>- RT #124469, #124494, perltidy often making empty files.  The previous had
183   an index error causing it to fail, particularly in version 5.18 of Perl.
184
185   Please avoid version 20180219.
186 </code></pre>
187
188 <h2>2018 02 19</h2>
189
190 <pre><code>- RT #79947, cuddled-else generalization. A new flag -cb provides
191   'cuddled-else' type formatting for an arbitrary type of block chain. The
192   default is try-catch-finally, but this can be modified with the 
193   parameter -cbl. 
194
195 - Fixed RT #124298: add space after ! operator without breaking !! secret 
196   operator
197
198 - RT #123749: numerous minor improvements to the -wn flag were made.  
199
200 - Fixed a problem with convergence tests in which iterations were stopping 
201   prematurely. 
202
203 - Here doc targets for &lt;&lt;~ type here-docs may now have leading whitespace.
204
205 - Fixed RT #124354. The '-indent-only' flag was not working correctly in the 
206   previous release. A bug in version 20180101 caused extra blank lines 
207   to be output.
208
209 - Issue RT #124114. Some improvements were made in vertical alignment
210   involving 'fat commas'.
211 </code></pre>
212
213 <h2>2018 01 01</h2>
214
215 <pre><code>- Added new flag -wn (--weld-nested-containers) which addresses these issues:
216   RT #123749: Problem with promises; 
217   RT #119970: opening token stacking strange behavior;
218   RT #81853: Can't stack block braces
219
220   This option causes closely nested pairs of opening and closing containers
221   to be "welded" together and essentially be formatted as a single unit,
222   with just one level of indentation.
223
224   Since this is a new flag it is set to be "off" by default but it has given 
225   excellent results in testing. 
226
227   EXAMPLE 1, multiple blocks, default formatting:
228       do {
229           {
230               next if $x == $y;    # do something here
231           }
232       } until $x++ &gt; $z;
233
234   perltidy -wn
235       do { {
236           next if $x == $y;
237       } } until $x++ &gt; $z;
238
239    EXAMPLE 2, three levels of wrapped function calls, default formatting:
240           p(
241               em(
242                   conjug(
243                       translate( param('verb') ), param('tense'),
244                       param('person')
245                   )
246               )
247           );
248
249       # perltidy -wn
250           p( em( conjug(
251               translate( param('verb') ),
252               param('tense'), param('person')
253           ) ) );
254
255       # EXAMPLE 3, chained method calls, default formatting:
256       get('http://mojolicious.org')-&gt;then(
257           sub {
258               my $mojo = shift;
259               say $mojo-&gt;res-&gt;code;
260               return get('http://metacpan.org');
261           }
262       )-&gt;then(
263           sub {
264               my $cpan = shift;
265               say $cpan-&gt;res-&gt;code;
266           }
267       )-&gt;catch(
268           sub {
269               my $err = shift;
270               warn "Something went wrong: $err";
271           }
272       )-&gt;wait;
273
274       # perltidy -wn
275       get('http://mojolicious.org')-&gt;then( sub {
276           my $mojo = shift;
277           say $mojo-&gt;res-&gt;code;
278           return get('http://metacpan.org');
279       } )-&gt;then( sub {
280           my $cpan = shift;
281           say $cpan-&gt;res-&gt;code;
282       } )-&gt;catch( sub {
283           my $err = shift;
284           warn "Something went wrong: $err";
285       } )-&gt;wait;
286
287
288 - Fixed RT #114359: Missparsing of "print $x ** 0.5;
289
290 - Deactivated the --check-syntax flag for better security.  It will be
291   ignored if set.  
292
293 - Corrected minimum perl version from 5.004 to 5.008 based on perlver
294   report.  The change is required for coding involving wide characters.
295
296 - For certain severe errors, the source file will be copied directly to the
297   output without formatting. These include ending in a quote, ending in a
298   here doc, and encountering an unidentified character.
299 </code></pre>
300
301 <h2>2017 12 14</h2>
302
303 <pre><code>- RT #123749, partial fix.  "Continuation indentation" is removed from lines 
304   with leading closing parens which are part of a call chain. 
305   For example, the call to pack() is is now outdented to the starting 
306   indentation in the following experession:  
307
308       # OLD
309       $mw-&gt;Button(
310           -text    =&gt; "New Document",
311           -command =&gt; \&amp;new_document
312         )-&gt;pack(
313           -side   =&gt; 'bottom',
314           -anchor =&gt; 'e'
315         );
316
317       # NEW
318       $mw-&gt;Button(
319           -text    =&gt; "New Document",
320           -command =&gt; \&amp;new_document
321       )-&gt;pack(
322           -side   =&gt; 'bottom',
323           -anchor =&gt; 'e'
324       );
325
326   This modification improves readability of complex expressions, especially
327   when the user uses the same value for continuation indentation (-ci=n) and 
328   normal indentation (-i=n).  Perltidy was already programmed to
329   do this but a minor bug was preventing it.
330
331 - RT #123774, added flag to control space between a backslash and a single or
332   double quote, requested by Robert Rothenberg.  The issue is that lines like
333
334      $str1=\"string1";
335      $str2=\'string2';
336
337   confuse syntax highlighters unless a space is left between the backslash and
338   the quote.
339
340   The new flag to control this is -sbq=n (--space-backslash-quote=n), 
341   where n=0 means no space, n=1 means follow existing code, n=2 means always
342   space.  The default is n=1, meaning that a space will be retained if there
343   is one in the source code.
344
345 - Fixed RT #123492, support added for indented here doc operator &lt;&lt;~ added 
346   in v5.26.  Thanks to Chris Weyl for the report.
347
348 - Fixed docs; --closing-side-comment-list-string should have been just
349   --closing-side-comment-list.  Thanks to F.Li.
350
351 - Added patch RT #122030] Perl::Tidy sometimes does not call binmode.
352   Thanks to Irilis Aelae.
353
354 - Fixed RT #121959, PERLTIDY doesn't honor the 'three dot' notation for 
355   locating a config file using environment variables.  Thanks to John 
356   Wittkowski.
357
358 - Minor improvements to formatting, in which some additional vertical
359   aligmnemt is done. Thanks to Keith Neargarder.
360
361 - RT #119588.  Vertical alignment is no longer done for // operator.
362 </code></pre>
363
364 <h2>2017 05 21</h2>
365
366 <pre><code>- Fixed debian #862667: failure to check for perltidy.ERR deletion can lead 
367   to overwriting abritrary files by symlink attack. Perltidy was continuing 
368   to write files after an unlink failure.  Thanks to Don Armstrong 
369   for a patch.
370
371 - Fixed RT #116344, perltidy fails on certain anonymous hash references:
372   in the following code snippet the '?' was misparsed as a pattern 
373   delimiter rather than a ternary operator.
374       return ref {} ? 1 : 0;
375
376 - Fixed RT #113792: misparsing of a fat comma (=&gt;) right after 
377   the __END__ or __DATA__ tokens.  These keywords were getting
378   incorrectly quoted by the following =&gt; operator.
379
380 - Fixed RT #118558. Custom Getopt::Long configuration breaks parsing 
381   of perltidyrc.  Perltidy was resetting the users configuration too soon.
382
383 - Fixed RT #119140, failure to parse double diamond operator.  Code to
384   handle this new operator has been added.
385
386 - Fixed RT #120968.  Fixed problem where -enc=utf8 didn't work 
387   with --backup-and-modify-in-place. Thanks to Heinz Knutzen for this patch.
388
389 - Fixed minor formatting issue where one-line blocks for subs with signatures 
390   were unnecesarily broken
391
392 - RT #32905, patch to fix utf-8 error when output was STDOUT. 
393
394 - RT #79947, improved spacing of try/catch/finally blocks. Thanks to qsimpleq
395   for a patch.
396
397 - Fixed #114909, Anonymous subs with signatures and prototypes misparsed as
398   broken ternaries, in which a statement such as this was not being parsed
399   correctly:
400       return sub ( $fh, $out ) : prototype(*$) { ... }
401
402 - Implemented RT #113689, option to introduces spaces after an opening block
403   brace and before a closing block brace. Four new optional controls are
404   added. The first two define the minimum number of blank lines to be
405   inserted 
406
407    -blao=i or --blank-lines-after-opening-block=i
408    -blbc=i or --blank-lines-before-closing-block=i
409
410   where i is an integer, the number of lines (the default is 0).  
411
412   The second two define the types of blocks to which the first two apply 
413
414    -blaol=s or --blank-lines-after-opening-block-list=s
415    -blbcl=s or --blank-lines-before-closing-block-list=s
416
417   where s is a string of possible block keywords (default is just 'sub',
418   meaning a named subroutine).
419
420   For more information please see the documentation.
421
422 - The method for specifying block types for certain input parameters has
423   been generalized to distinguish between normal named subroutines and
424   anonymous subs.  The keyword for normal subroutines remains 'sub', and
425   the new keyword for anonymous subs is 'asub'. 
426
427 - Minor documentation changes. The BUGS sections now have a link
428   to CPAN where most open bugs and issues can be reviewed and bug reports
429   can be submitted.  The information in the AUTHOR and CREDITS sections of
430   the man pages have been removed from the man pages to streamline the
431   documentation. This information is still in the source code.
432 </code></pre>
433
434 <h2>2016 03 02</h2>
435
436 <pre><code>- RT #112534. Corrected a minor problem in which an unwanted newline
437   was placed before the closing brace of an anonymous sub with 
438   a signature, if it was in a list.  Thanks to Dmytro Zagashev.
439
440 - Corrected a minor problem in which occasional extra indentation was
441   given to the closing brace of an anonymous sub in a list when the -lp 
442   parameter was set.
443 </code></pre>
444
445 <h2>2016 03 01</h2>
446
447 <pre><code> - RT #104427. Added support for signatures.
448
449  - RT #111512.  Changed global warning flag $^W = 1 to use warnings;
450    Thanks to Dmytro Zagashev.
451
452  - RT #110297, added support for new regexp modifier /n
453    Thanks to Dmytro Zagashev.
454
455  - RT #111519.  The -io (--indent-only) and -dac (--delete-all-comments)
456    can now both be used in one pass. Thanks to Dmitry Veltishev.
457
458  - Patch to avoid error message with 'catch' used by TryCatch, as in
459       catch($err){
460          # do something
461       }
462    Thanks to Nick Tonkin.
463
464  - RT #32905, UTF-8 coding is now more robust. Thanks to qsimpleq
465    and Dmytro for patches.
466
467  - RT #106885. Added string bitwise operators ^. &amp;. |. ~. ^.= &amp;.= |.=
468
469  - Fixed RT #107832 and #106492, lack of vertical alignment of two lines
470    when -boc flag (break at old commas) is set.  This bug was 
471    inadvertantly introduced in previous bug fix RT #98902. 
472
473  - Some common extensions to Perl syntax are handled better.
474    In particular, the following snippet is now foratted cleanly:
475
476      method deposit( Num $amount) {
477          $self-&gt;balance( $self-&gt;balance + $amount );
478      }
479
480    A new flag -xs (--extended-syntax) was added to enable this, and the default
481    is to use -xs. 
482
483    In previous versions, and now only when -nxs is set, this snippet of code
484    generates the following error message:
485
486    "syntax error at ') {', didn't see one of: case elsif for foreach given if switch unless until when while"
487 </code></pre>
488
489 <h2>2015 08 15</h2>
490
491 <pre><code> - Fixed RT# 105484, Invalid warning about 'else' in 'switch' statement.  The
492    warning happened if a 'case' statement did not use parens.
493
494  - Fixed RT# 101547, misparse of // caused error message.  Also..
495
496  - Fixed RT# 102371, misparse of // caused unwated space in //=
497
498  - Fixed RT# 100871, "silent failure of HTML Output on Windows". 
499    Changed calls to tempfile() from:
500      my ( $fh_tmp, $tmpfile ) = tempfile();
501    to have the full path name:
502      my ( $fh_tmp, $tmpfile ) = File::Temp::tempfile()
503    because of problems in the Windows version reported by Dean Pearce.
504
505  - Fixed RT# 99514, calling the perltidy module multiple times with 
506    a .perltidyrc file containing the parameter --output-line-ending 
507    caused a crash.  This was a glitch in the memoization logic. 
508
509  - Fixed RT#99961, multiple lines inside a cast block caused unwanted
510    continuation indentation.  
511
512  - RT# 32905, broken handling of UTF-8 strings. 
513    A new flag -utf8 causes perltidy assume UTF-8 encoding for input and 
514    output of an io stream.  Thanks to Sebastian Podjasek for a patch.  
515    This feature may not work correctly in older versions of Perl. 
516    It worked in a linux version 5.10.1 but not in a Windows version 5.8.3 (but
517    otherwise perltidy ran correctly).
518
519  - Warning files now report perltidy VERSION. Suggested by John Karr.
520
521  - Fixed long flag --nostack-closing-tokens (-nsct has always worked though). 
522    This was due to a typo.  This also fixed --nostack-opening-tokens to 
523    behave correctly.  Thanks to Rob Dixon.
524 </code></pre>
525
526 <h2>2014 07 11</h2>
527
528 <pre><code>- Fixed RT #94902: abbreviation parsing in .perltidyrc files was not
529   working for multi-line abbreviations.  Thanks to Eric Fung for 
530   supplying a patch. 
531
532 - Fixed RT #95708, misparsing of a hash when the first key was a perl
533   keyword, causing a semicolon to be incorrectly added.
534
535 - Fixed RT #94338 for-loop in a parenthesized block-map.  A code block within
536   parentheses of a map, sort, or grep function was being mistokenized.  In 
537   rare cases this could produce in an incorrect error message.  The fix will
538   produce some minor formatting changes.  Thanks to Daniel Trizen 
539   discovering and documenting this.
540
541 - Fixed RT #94354, excess indentation for stacked tokens.  Thanks to 
542   Colin Williams for supplying a patch.
543
544 - Added support for experimental postfix dereferencing notation introduced in
545   perl 5.20. RT #96021.
546
547 - Updated documentation to clarify the behavior of the -io flag
548   in response to RT #95709.  You can add -noll or -l=0 to prevent 
549   long comments from being outdented when -io is used.
550
551 - Added a check to prevent a problem reported in RT #81866, where large
552   scripts which had been compressed to a single line could not be formatted
553   because of a check for VERSION for MakeMaker. The workaround was to 
554   use -nvpl, but this shouldn't be necessary now.
555
556 - Fixed RT #96101; Closing brace of anonymous sub in a list was being
557   indented.  For example, the closing brace of the anonymous sub below 
558   will now be lined up with the word 'callback'.  This problem 
559   occured if there was no comma after the closing brace of the anonymous sub.  
560   This update may cause minor changes to formatting of code with lists 
561   of anonymous subs, especially TK code.
562
563   # OLD
564   my @menu_items = (
565
566       #...
567       {
568           path     =&gt; '/_Operate/Transcode and split',
569           callback =&gt; sub {
570               return 1 if not $self-&gt;project_opened;
571               $self-&gt;comp('project')-&gt;transcode( split =&gt; 1 );
572             }
573       }
574   );
575
576   # NEW
577   my @menu_items = (
578
579       #...
580       {
581           path     =&gt; '/_Operate/Transcode and split',
582           callback =&gt; sub {
583               return 1 if not $self-&gt;project_opened;
584               $self-&gt;comp('project')-&gt;transcode( split =&gt; 1 );
585           }
586       }
587   );
588 </code></pre>
589
590 <h2>2014 03 28</h2>
591
592 <pre><code>- Fixed RT #94190 and debian Bug #742004: perltidy.LOG file left behind.
593   Thanks to George Hartzell for debugging this.  The problem was
594   caused by the memoization speedup patch in version 20121207.  An
595   unwanted flag was being set which caused a LOG to be written if 
596   perltidy was called multiple times.
597
598 - New default behavior for LOG files: If the source is from an array or 
599   string (through a call to the perltidy module) then a LOG output is only
600   possible if a logfile stream is specified.  This is to prevent 
601   unexpected perltidy.LOG files. 
602
603 - Fixed debian Bug #740670, insecure temporary file usage.  File::Temp is now
604   used to get a temporary file.  Thanks to Don Anderson for a patch.
605
606 - Any -b (--backup-and-modify-in-place) flag is silently ignored when a 
607   source stream, destination stream, or standard output is used.  
608   This is because the -b flag may have been in a .perltidyrc file and 
609   warnings break Test::NoWarnings.  Thanks to Marijn Brand.
610 </code></pre>
611
612 <h2>2013 09 22</h2>
613
614 <pre><code>- Fixed RT #88020. --converge was not working with wide characters.
615
616 - Fixed RT #78156. package NAMESPACE VERSION syntax not accepted.
617
618 - First attempt to fix RT #88588.  INDEX END tag change in pod2html breaks 
619   perltidy -html. I put in a patch which should work but I don't yet have
620   a way of testing it.
621 </code></pre>
622
623 <h2>2013 08 06</h2>
624
625 <pre><code>- Fixed RT #87107, spelling
626 </code></pre>
627
628 <h2>2013 08 05</h2>
629
630 <pre><code>- Fixed RT #87502, incorrect of parsing of smartmatch before hash brace
631
632 - Added feature request RT #87330, trim whitespace after POD.
633   The flag -trp (--trim-pod) will trim trailing whitespace from lines of POD
634 </code></pre>
635
636 <h2>2013 07 17</h2>
637
638 <pre><code>- Fixed RT #86929, #86930, missing lhs of assignment.
639
640 - Fixed RT #84922, moved pod from Tidy.pm into Tidy.pod
641 </code></pre>
642
643 <h2>2012 12 07</h2>
644
645 <pre><code>- The flag -cab=n or --comma-arrow-breakpoints=n has been generalized
646   to give better control over breaking open short containers.  The
647   possible values are now:
648
649     n=0 break at all commas after =&gt;  
650     n=1 stable: break at all commas after =&gt; if container is open,
651         EXCEPT FOR one-line containers
652     n=2 break at all commas after =&gt;, BUT try to form the maximum
653         maximum one-line container lengths
654     n=3 do not treat commas after =&gt; specially at all 
655     n=4 break everything: like n=0 but also break a short container with
656         a =&gt; not followed by a comma
657     n=5 stable: like n=1 but ALSO break at open one-line containers (default)
658
659   New values n=4 and n=5 have been added to allow short blocks to be
660   broken open.  The new default is n=5, stable.  It should more closely
661   follow the breaks in the input file, and previously formatted code
662   should remain unchanged.  If this causes problems use -cab=1 to recover 
663   the former behavior.  Thanks to Tony Maszeroski for the suggestion.
664
665   To illustrate the need for the new options, if perltidy is given
666   the following code, then the old default (-cab=1) was to close up 
667   the 'index' container even if it was open in the source.  The new 
668   default (-cab=5) will keep it open if it was open in the source.
669
670    our $fancypkg = {
671        'ALL' =&gt; {
672            'index' =&gt; {
673                'key' =&gt; 'value',
674            },
675            'alpine' =&gt; {
676                'one'   =&gt; '+',
677                'two'   =&gt; '+',
678                'three' =&gt; '+',
679            },
680        }
681    };
682
683 - New debug flag --memoize (-mem).  This version contains a 
684   patch supplied by Jonathan Swartz which can significantly speed up
685   repeated calls to Perl::Tidy::perltidy in a single process by caching
686   the result of parsing the formatting parameters.  A factor of up to 10
687   speedup was achieved for masontidy (https://metacpan.org/module/masontidy).
688   The memoization patch is on by default but can be deactivated for 
689   testing with -nmem (or --no-memoize).
690
691 - New flag -tso (--tight-secret-operators) causes certain perl operator
692   sequences (secret operators) to be formatted "tightly" (without spaces).  
693   The most common of these are 0 +  and + 0 which become 0+ and +0.  The
694   operators currently modified by this flag are: 
695        =( )=  0+  +0  ()x!! ~~&lt;&gt;  ,=&gt;
696   Suggested by by Philippe Bruhat. See https://metacpan.org/module/perlsecret
697   This flag is off by default.
698
699 - New flag -vmll (--variable-maximum-line-length) makes the maximum
700   line length increase with the nesting depth of a line of code.  
701   Basically, it causes the length of leading whitespace to be ignored when
702   setting line breaks, so the formatting of a block of code is independent
703   of its nesting depth.  Try this option if you have deeply nested 
704   code or data structures, perhaps in conjunction with the -wc flag
705   described next.  The default is not todo this.
706
707 - New flag -wc=n (--whitespace-cycle=n) also addresses problems with
708   very deeply nested code and data structures.  When this parameter is
709   used and the nesting depth exceeds the value n, the leading whitespace 
710   will be reduced and start at 1 again.  The result is that deeply
711   nested blocks of code will shift back to the left. This occurs cyclically 
712   to any nesting depth.  This flag may be used either with or without -vmll.
713   The default is not to use this (-wc=0).
714
715 - Fixed RT #78764, error parsing smartmatch operator followed by anonymous
716   hash or array and then a ternary operator; two examples:
717
718    qr/3/ ~~ ['1234'] ? 1 : 0;
719    map { $_ ~~ [ '0', '1' ] ? 'x' : 'o' } @a;
720
721 - Fixed problem with specifying spaces around arrows using -wls='-&gt;'
722   and -wrs='-&gt;'.  Thanks to Alain Valleton for documenting this problem. 
723
724 - Implemented RT #53183, wishlist, lines of code with the same indentation
725   level which are contained with multiple stacked opening and closing tokens
726   (requested with flags -sot -sct) now have reduced indentation.  
727
728    # Default
729    $sender-&gt;MailMsg(
730        {
731            to      =&gt; $addr,
732            subject =&gt; $subject,
733            msg     =&gt; $body
734        }
735    );
736
737    # OLD: perltidy -sot -sct 
738    $sender-&gt;MailMsg( {
739            to      =&gt; $addr,
740            subject =&gt; $subject,
741            msg     =&gt; $body
742    } );
743
744    # NEW: perltidy -sot -sct 
745    $sender-&gt;MailMsg( {
746        to      =&gt; $addr,
747        subject =&gt; $subject,
748        msg     =&gt; $body
749    } );
750
751 - New flag -act=n (--all-containers-tightness=n) is an abbreviation for
752   -pt=n -sbt=n -bt=n -bbt=n, where n=0,1, or 2.  It simplifies input when all
753   containers have the same tightness. Using the same example:
754
755    # NEW: perltidy -sot -sct -act=2
756    $sender-&gt;MailMsg({
757        to      =&gt; $addr,
758        subject =&gt; $subject,
759        msg     =&gt; $body
760    });
761
762 - New flag -sac (--stack-all-containers) is an abbreviation for -sot -sct
763   This is part of wishlist item RT #53183. Using the same example again:
764
765    # NEW: perltidy -sac -act=2
766    $sender-&gt;MailMsg({
767        to      =&gt; $addr,
768        subject =&gt; $subject,
769        msg     =&gt; $body
770    });
771
772  - new flag -scbb (--stack-closing-block-brace) causes isolated closing 
773    block braces to stack as in the following example. (Wishlist item RT#73788)
774
775    DEFAULT:
776    for $w1 (@w1) {
777        for $w2 (@w2) {
778            for $w3 (@w3) {
779                for $w4 (@w4) {
780                    push( @lines, "$w1 $w2 $w3 $w4\n" );
781                }
782            }
783        }
784    }
785
786    perltidy -scbb:
787    for $w1 (@w1) {
788        for $w2 (@w2) {
789            for $w3 (@w3) {
790                for $w4 (@w4) {
791                    push( @lines, "$w1 $w2 $w3 $w4\n" );
792                } } } }
793
794   There is, at present, no flag to place these closing braces at the end
795   of the previous line. It seems difficult to develop good rules for 
796   doing this for a wide variety of code and data structures.
797
798 - Parameters defining block types may use a wildcard '*' to indicate
799   all block types.  Previously it was not possible to include bare blocks.
800
801 - A flag -sobb (--stack-opening-block-brace) has been introduced as an
802   alias for -bbvt=2 -bbvtl='*'.  So for example the following test code:
803
804   {{{{{{{ $testing }}}}}}}
805
806   cannot be formatted as above but can at least be kept vertically compact 
807   using perltidy -sobb -scbb
808
809   {   {   {   {   {   {   {   $testing
810                           } } } } } } }
811
812   Or even, perltidy -sobb -scbb -i=1 -bbt=2
813   {{{{{{{$testing
814         }}}}}}}
815
816
817 - Error message improved for conflicts due to -pbp; thanks to Djun Kim.
818
819 - Fixed RT #80645, error parsing special array name '@$' when used as 
820   @{$} or $#{$}
821
822 - Eliminated the -chk debug flag which was included in version 20010406 to
823   do a one-time check for a bug with multi-line quotes.  It has not been
824   needed since then.
825
826 - Numerous other minor formatting improvements.
827 </code></pre>
828
829 <h2>2012 07 14</h2>
830
831 <pre><code>- Added flag -iscl (--ignore-side-comment-lengths) which causes perltidy 
832   to ignore the length of side comments when setting line breaks, 
833   RT #71848.  The default is to include the length of side comments when
834   breaking lines to stay within the length prescribed by the -l=n
835   maximum line length parameter.  For example,
836
837     Default behavior on a single line with long side comment:
838        $vmsfile =~ s/;[\d\-]*$//
839          ;    # Clip off version number; we can use a newer version as well
840
841     perltidy -iscl leaves the line intact:
842
843        $vmsfile =~ s/;[\d\-]*$//; # Clip off version number; we can use a newer version as well
844
845 - Fixed RT #78182, side effects with STDERR.  Error handling has been
846   revised and the documentation has been updated.  STDERR can now be 
847   redirected to a string reference, and perltidy now returns an 
848   error flag instead of calling die when input errors are detected. 
849   If the error flag is set then no tidied output was produced.
850   See man Perl::Tidy for an example.
851
852 - Fixed RT #78156, erroneous warning message for package VERSION syntax.
853
854 - Added abbreviations -conv (--converge) to simplify iteration control.
855   -conv is equivalent to -it=4 and will insure that the tidied code is
856   converged to its final state with the minimum number of iterations.
857
858 - Minor formatting modifications have been made to insure convergence.
859
860 - Simplified and hopefully improved the method for guessing the starting 
861   indentation level of entabbed code.  Added flag -dt=n (--default_tabsize=n) 
862   which might be helpful if the guessing method does not work well for
863   some editors.
864
865 - Added support for stacked labels, upper case X/B in hex and binary, and
866   CORE:: namespace.
867
868 - Eliminated warning messages for using keyword names as constants.
869 </code></pre>
870
871 <h2>2012 07 01</h2>
872
873 <pre><code>- Corrected problem introduced by using a chomp on scalar references, RT #77978
874
875 - Added support for Perl 5.14 package block syntax, RT #78114.
876
877 - A convergence test is made if three or more iterations are requested with
878   the -it=n parameter to avoid wasting computer time.  Several hundred Mb of
879   code gleaned from the internet were searched with the results that: 
880    - It is unusual for two iterations to be required unless a major 
881      style change is being made. 
882    - Only one case has been found where three iterations were required.  
883    - No cases requiring four iterations have been found with this version.
884   For the previous version several cases where found the results could
885   oscillate between two semi-stable states. This version corrects this.
886
887   So if it is important that the code be converged it is okay to set -it=4
888   with this version and it will probably stop after the second iteration.
889
890 - Improved ability to identify and retain good line break points in the
891   input stream, such as at commas and equals. You can always tell 
892   perltidy to ignore old breakpoints with -iob.  
893
894 - Fixed glitch in which a terminal closing hash brace followed by semicolon
895   was not outdented back to the leading line depth like other closing
896   tokens.  Thanks to Keith Neargarder for noting this.
897
898     OLD:
899        my ( $pre, $post ) = @{
900            {
901                "pp_anonlist" =&gt; [ "[", "]" ],
902                "pp_anonhash" =&gt; [ "{", "}" ]
903            }-&gt;{ $kid-&gt;ppaddr }
904          };   # terminal brace
905
906     NEW:
907        my ( $pre, $post ) = @{
908            {
909                "pp_anonlist" =&gt; [ "[", "]" ],
910                "pp_anonhash" =&gt; [ "{", "}" ]
911            }-&gt;{ $kid-&gt;ppaddr }
912        };    # terminal brace
913
914 - Removed extra indentation given to trailing 'if' and 'unless' clauses 
915   without parentheses because this occasionally produced undesirable 
916   results.  This only applies where parens are not used after the if or
917   unless.
918
919    OLD:
920        return undef
921          unless my ( $who, $actions ) =
922              $clause =~ /^($who_re)((?:$action_re)+)$/o; 
923
924    NEW:
925        return undef
926          unless my ( $who, $actions ) =
927          $clause =~ /^($who_re)((?:$action_re)+)$/o;
928 </code></pre>
929
930 <h2>2012 06 19</h2>
931
932 <pre><code>- Updated perltidy to handle all quote modifiers defined for perl 5 version 16.
933
934 - Side comment text in perltidyrc configuration files must now begin with
935   at least one space before the #.  Thus:
936
937   OK:
938     -l=78 # Max line width is 78 cols
939   BAD: 
940     -l=78# Max line width is 78 cols
941
942   This is probably true of almost all existing perltidyrc files, 
943   but if you get an error message about bad parameters
944   involving a '#' the first time you run this version, please check the side
945   comments in your perltidyrc file, and add a space before the # if necessary.
946   You can quickly see the contents your perltidyrc file, if any, with the
947   command:
948
949     perltidy -dpro
950
951   The reason for this change is that some parameters naturally involve
952   the # symbol, and this can get interpreted as a side comment unless the
953   parameter is quoted.  For example, to define -sphb=# it used to be necessary
954   to write
955     -sbcp='#'
956   to keep the # from becoming part of a comment.  This was causing 
957   trouble for new users.  Now it can also be written without quotes: 
958     -sbcp=#
959
960 - Fixed bug in processing some .perltidyrc files containing parameters with
961   an opening brace character, '{'.  For example the following was
962   incorrectly processed:
963      --static-block-comment-prefix="^#{2,}[^\s#]"
964   Thanks to pdagosto.
965
966 - Added flag -boa (--break-at-old-attribute-breakpoints) which retains
967   any existing line breaks at attribute separation ':'. This is now the
968   default, use -nboa to deactivate.  Thanks to Daphne Phister for the patch.  
969   For example, given the following code, the line breaks at the ':'s will be
970   retained:
971
972                    my @field
973                      : field
974                      : Default(1)
975                      : Get('Name' =&gt; 'foo') : Set('Name');
976
977   whereas the previous version would have output a single line.  If
978   the attributes are on a single line then they will remain on a single line.
979
980 - Added new flags --blank-lines-before-subs=n (-blbs=n) and
981   --blank-lines-before-packages=n (-blbp=n) to put n blank lines before
982   subs and packages.  The old flag -bbs is now equivalent to -blbs=1 -blbp=1.
983   and -nbbs is equivalent to -blbs=0 -blbp=0. Requested by M. Schwern and
984   several others.
985
986 - Added feature -nsak='*' meaning no space between any keyword and opening 
987   paren.  This avoids listing entering a long list of keywords.  Requested
988   by M. Schwern.
989
990 - Added option to delete a backup of original file with in-place-modify (-b)
991   if there were no errors.  This can be requested with the flag -bext='/'.  
992   See documentation for details.  Requested by M. Schwern and others.
993
994 - Fixed bug where the module postfilter parameter was not applied when -b 
995   flag was used.  This was discovered during testing.
996
997 - Fixed in-place-modify (-b) to work with symbolic links to source files.
998   Thanks to Ted Johnson.
999
1000 - Fixed bug where the Perl::Tidy module did not allow -b to be used 
1001   in some cases.
1002
1003 - No extra blank line is added before a comment which follows
1004   a short line ending in an opening token, for example like this:
1005    OLD:
1006            if (
1007
1008                # unless we follow a blank or comment line
1009                $last_line_leading_type !~ /^[#b]$/
1010                ...
1011
1012    NEW:
1013            if (
1014                # unless we follow a blank or comment line
1015                $last_line_leading_type !~ /^[#b]$/
1016                ...
1017
1018    The blank is not needed for readability in these cases because there
1019    already is already space above the comment.  If a blank already 
1020    exists there it will not be removed, so this change should not 
1021    change code which has previously been formatted with perltidy. 
1022    Thanks to R.W.Stauner.
1023
1024 - Likewise, no extra blank line is added above a comment consisting of a
1025   single #, since nothing is gained in readability.
1026
1027 - Fixed error in which a blank line was removed after a #&gt;&gt;&gt; directive. 
1028   Thanks to Ricky Morse.
1029
1030 - Unnecessary semicolons after given/when/default blocks are now removed.
1031
1032 - Fixed bug where an unwanted blank line could be added before
1033   pod text in __DATA__ or __END__ section.  Thanks to jidani.
1034
1035 - Changed exit flags from 1 to 0 to indicate success for -help, -version, 
1036   and all -dump commands.  Also added -? as another way to dump the help.
1037   Requested by Keith Neargarder.
1038
1039 - Fixed bug where .ERR and .LOG files were not written except for -it=2 or more
1040
1041 - Fixed bug where trailing blank lines at the end of a file were dropped when
1042   -it&gt;1.
1043
1044 - Fixed bug where a line occasionally ended with an extra space. This reduces
1045   rhe number of instances where a second iteration gives a result different
1046   from the first. 
1047
1048 - Updated documentation to note that the Tidy.pm module &lt;stderr&gt; parameter may
1049   not be a reference to SCALAR or ARRAY; it must be a file.
1050
1051 - Syntax check with perl now work when the Tidy.pm module is processing
1052   references to arrays and strings.  Thanks to Charles Alderman.
1053
1054 - Zero-length files are no longer processed due to concerns for data loss
1055   due to side effects in some scenarios.
1056
1057 - block labels, if any, are now included in closing side comment text
1058   when the -csc flag is used.  Suggested by Aaron.  For example, 
1059   the label L102 in the following block is now included in the -csc text:
1060
1061      L102: for my $i ( 1 .. 10 ) {
1062        ...
1063      } ## end L102: for my $i ( 1 .. 10 )
1064 </code></pre>
1065
1066 <h2>2010 12 17</h2>
1067
1068 <pre><code>- added new flag -it=n or --iterations=n
1069   This flag causes perltidy to do n complete iterations.  
1070   For most purposes the default of n=1 should be satisfactory.  However n=2
1071   can be useful when a major style change is being made, or when code is being
1072   beautified on check-in to a source code control system.  The run time will be
1073   approximately proportional to n, and it should seldom be necessary to use a
1074   value greater than n=2.  Thanks to Jonathan Swartz
1075
1076 - A configuration file pathname begins with three dots, e.g.
1077   ".../.perltidyrc", indicates that the file should be searched for starting
1078   in the current directory and working upwards. This makes it easier to have
1079   multiple projects each with their own .perltidyrc in their root directories.
1080   Thanks to Jonathan Swartz for this patch.
1081
1082 - Added flag --notidy which disables all formatting and causes the input to be
1083   copied unchanged.  This can be useful in conjunction with hierarchical
1084   F&lt;.perltidyrc&gt; files to prevent unwanted tidying.
1085   Thanks to Jonathan Swartz for this patch.
1086
1087 - Added prefilters and postfilters in the call to the Tidy.pm module.
1088   Prefilters and postfilters. The prefilter is a code reference that 
1089   will be applied to the source before tidying, and the postfilter 
1090   is a code reference to the result before outputting.  
1091
1092   Thanks to Jonathan Swartz for this patch.  He writes:
1093   This is useful for all manner of customizations. For example, I use
1094   it to convert the 'method' keyword to 'sub' so that perltidy will work for
1095   Method::Signature::Simple code:
1096
1097   Perl::Tidy::perltidy(
1098      prefilter =&gt; sub { $_ = $_[0]; s/^method (.*)/sub $1 \#__METHOD/gm; return $_ },
1099      postfilter =&gt; sub { $_ = $_[0]; s/^sub (.*?)\s* \#__METHOD/method $1/gm; return $_ }
1100   );
1101
1102 - The starting indentation level of sections of code entabbed with -et=n
1103   is correctly guessed if it was also produced with the same -et=n flag.  This
1104   keeps the indentation stable on repeated formatting passes within an editor.
1105   Thanks to Sam Kington and Glenn.
1106
1107 - Functions with prototype '&amp;' had a space between the function and opening
1108   peren.  This space now only occurs if the flag --space-function-paren (-sfp)
1109   is set.  Thanks to Zrajm Akfohg.
1110
1111 - Patch to never put spaces around a bare word in braces beginning with ^ as in:
1112     my $before = ${^PREMATCH};
1113   even if requested with the -bt=0 flag because any spaces cause a syntax error in perl.
1114   Thanks to Fabrice Dulanoy.
1115 </code></pre>
1116
1117 <h2>2009 06 16</h2>
1118
1119 <pre><code>- Allow configuration file to be 'perltidy.ini' for Windows systems.
1120   i.e. C:\Documents and Settings\User\perltidy.ini
1121   and added documentation for setting configuation file under Windows in man
1122   page.  Thanks to Stuart Clark.
1123
1124 - Corrected problem of unwanted semicolons in hash ref within given/when code.
1125  Thanks to Nelo Onyiah.
1126
1127 - added new flag -cscb or --closing-side-comments-balanced
1128  When using closing-side-comments, and the closing-side-comment-maximum-text
1129  limit is exceeded, then the comment text must be truncated.  Previous
1130  versions of perltidy terminate with three dots, and this can still be
1131  achieved with -ncscb:
1132
1133   perltidy -csc -ncscb
1134
1135   } ## end foreach my $foo (sort { $b cmp $a ...
1136
1137  However this causes a problem with older editors which cannot recognize
1138  comments or are not configured to doso because they cannot "bounce" around in
1139  the text correctly.  The B&lt;-cscb&gt; flag tries to help them by 
1140  appending appropriate terminal balancing structure:
1141
1142   perltidy -csc -cscb
1143
1144   } ## end foreach my $foo (sort { $b cmp $a ... })
1145
1146  Since there is much to be gained and little to be lost by doing this,
1147  the default is B&lt;-cscb&gt;.  Use B&lt;-ncscb&gt; if you do not want this.
1148
1149  Thanks to Daniel Becker for suggesting this option.
1150
1151 - After an isolated closing eval block the continuation indentation will be
1152   removed so that the braces line up more like other blocks.  Thanks to Yves Orton.
1153
1154 OLD:
1155    eval {
1156        #STUFF;
1157        1;    # return true
1158      }  
1159      or do {
1160        #handle error
1161      };
1162
1163 NEW:
1164    eval {
1165        #STUFF;
1166        1;    # return true
1167    } or do {
1168        #handle error
1169    };
1170
1171 -A new flag -asbl (or --opening-anonymous-sub-brace-on-new-line) has
1172  been added to put the opening brace of anonymous sub's on a new line,
1173  as in the following snippet:
1174
1175    my $code = sub
1176    {
1177        my $arg = shift;
1178        return $arg-&gt;(@_);
1179    };
1180
1181  This was not possible before because the -sbl flag only applies to named
1182  subs. Thanks to Benjamin Krupp.
1183
1184 -Fix tokenization bug with the following snippet
1185   print 'hi' if { x =&gt; 1, }-&gt;{x};
1186  which resulted in a semicolon being added after the comma.  The workaround
1187  was to use -nasc, but this is no longer necessary.  Thanks to Brian Duggan. 
1188
1189 -Fixed problem in which an incorrect error message could be triggered
1190 by the (unusual) combination of parameters  -lp -i=0 -l=2 -ci=0 for
1191 example.  Thanks to Richard Jelinek.
1192
1193 -A new flag --keep-old-blank-lines=n has been added to
1194 give more control over the treatment of old blank lines in
1195 a script.  The manual has been revised to discuss the new
1196 flag and clarify the treatment of old blank lines.  Thanks
1197 to Oliver Schaefer.
1198 </code></pre>
1199
1200 <h2>2007 12 05</h2>
1201
1202 <pre><code>-Improved support for perl 5.10: New quote modifier 'p', new block type UNITCHECK, 
1203 new keyword break, improved formatting of given/when.
1204
1205 -Corrected tokenization bug of something like $var{-q}.
1206
1207 -Numerous minor formatting improvements.
1208
1209 -Corrected list of operators controlled by -baao -bbao to include
1210   . : ? &amp;&amp; || and or err xor
1211
1212 -Corrected very minor error in log file involving incorrect comment
1213 regarding need for upper case of labels.  
1214
1215 -Fixed problem where perltidy could run for a very long time
1216 when given certain non-perl text files.
1217
1218 -Line breaks in un-parenthesized lists now try to follow
1219 line breaks in the input file rather than trying to fill
1220 lines.  This usually works better, but if this causes
1221 trouble you can use -iob to ignore any old line breaks.
1222 Example for the following input snippet:
1223
1224    print
1225    "conformability (Not the same dimension)\n",
1226    "\t", $have, " is ", text_unit($hu), "\n",
1227    "\t", $want, " is ", text_unit($wu), "\n",
1228    ;
1229
1230  OLD:
1231    print "conformability (Not the same dimension)\n", "\t", $have, " is ",
1232      text_unit($hu), "\n", "\t", $want, " is ", text_unit($wu), "\n",;
1233
1234  NEW:
1235    print "conformability (Not the same dimension)\n",
1236      "\t", $have, " is ", text_unit($hu), "\n",
1237      "\t", $want, " is ", text_unit($wu), "\n",
1238      ;
1239 </code></pre>
1240
1241 <h2>2007 08 01</h2>
1242
1243 <pre><code>-Added -fpsc option (--fixed-position-side-comment). Thanks to Ueli Hugenschmidt. 
1244 For example -fpsc=40 tells perltidy to put side comments in column 40
1245 if possible.  
1246
1247 -Added -bbao and -baao options (--break-before-all-operators and
1248 --break-after-all-operators) to simplify command lines and configuration
1249 files.  These define an initial preference for breaking at operators which can
1250 be modified with -wba and -wbb flags.  For example to break before all operators
1251 except an = one could use --bbao -wba='=' rather than listing every
1252 single perl operator (except =) on a -wbb flag.
1253
1254 -Added -kis option (--keep-interior-semicolons).  Use the B&lt;-kis&gt; flag
1255 to prevent breaking at a semicolon if there was no break there in the
1256 input file.  To illustrate, consider the following input lines:
1257
1258    dbmclose(%verb_delim); undef %verb_delim;
1259    dbmclose(%expanded); undef %expanded;
1260    dbmclose(%global); undef %global;
1261
1262 Normally these would be broken into six lines, but 
1263 perltidy -kis gives:
1264
1265    dbmclose(%verb_delim); undef %verb_delim;
1266    dbmclose(%expanded);   undef %expanded;
1267    dbmclose(%global);     undef %global;
1268
1269 -Improved formatting of complex ternary statements, with indentation
1270 of nested statements.  
1271  OLD:
1272    return defined( $cw-&gt;{Selected} )
1273      ? (wantarray)
1274      ? @{ $cw-&gt;{Selected} }
1275      : $cw-&gt;{Selected}[0]
1276      : undef;
1277
1278  NEW:
1279    return defined( $cw-&gt;{Selected} )
1280      ? (wantarray)
1281          ? @{ $cw-&gt;{Selected} }
1282          : $cw-&gt;{Selected}[0]
1283      : undef;
1284
1285 -Text following un-parenthesized if/unless/while/until statements get a
1286 full level of indentation.  Suggested by Jeff Armstorng and others. 
1287 OLD:
1288    return $ship-&gt;chargeWeapons("phaser-canon")
1289      if $encounter-&gt;description eq 'klingon'
1290      and $ship-&gt;firepower &gt;= $encounter-&gt;firepower
1291      and $location-&gt;status ne 'neutral';
1292 NEW:
1293    return $ship-&gt;chargeWeapons("phaser-canon")
1294      if $encounter-&gt;description eq 'klingon'
1295          and $ship-&gt;firepower &gt;= $encounter-&gt;firepower
1296          and $location-&gt;status ne 'neutral';
1297 </code></pre>
1298
1299 <h2>2007 05 08</h2>
1300
1301 <pre><code>-Fixed bug where #line directives were being indented.  Thanks to
1302 Philippe Bruhat.
1303 </code></pre>
1304
1305 <h2>2007 05 04</h2>
1306
1307 <pre><code>-Fixed problem where an extra blank line was added after an =cut when either
1308 (a) the =cut started (not stopped) a POD section, or (b) -mbl &gt; 1. 
1309 Thanks to J. Robert Ray and Bill Moseley.
1310 </code></pre>
1311
1312 <h2>2007 04 24</h2>
1313
1314 <pre><code>-ole (--output-line-ending) and -ple (--preserve-line-endings) should
1315 now work on all systems rather than just unix systems. Thanks to Dan
1316 Tyrell.
1317
1318 -Fixed problem of a warning issued for multiple subs for BEGIN subs
1319 and other control subs. Thanks to Heiko Eissfeldt.
1320
1321 -Fixed problem where no space was introduced between a keyword or
1322 bareword and a colon, such as:
1323
1324 ( ref($result) eq 'HASH' &amp;&amp; !%$result ) ? undef: $result;
1325
1326 Thanks to Niek.
1327
1328 -Added a utility program 'break_long_quotes.pl' to the examples directory of
1329 the distribution.  It breaks long quoted strings into a chain of concatenated
1330 sub strings no longer than a selected length.  Suggested by Michael Renner as
1331 a perltidy feature but was judged to be best done in a separate program.
1332
1333 -Updated docs to remove extra &lt; and &gt;= from list of tokens 
1334 after which breaks are made by default.  Thanks to Bob Kleemann.
1335
1336 -Removed improper uses of $_ to avoid conflicts with external calls, giving
1337 error message similar to:
1338    Modification of a read-only value attempted at 
1339    /usr/share/perl5/Perl/Tidy.pm line 6907.
1340 Thanks to Michael Renner.
1341
1342 -Fixed problem when errorfile was not a plain filename or filehandle
1343 in a call to Tidy.pm.  The call
1344 perltidy(source =&gt; \$input, destination =&gt; \$output, errorfile =&gt; \$err);
1345 gave the following error message:
1346  Not a GLOB reference at /usr/share/perl5/Perl/Tidy.pm line 3827.
1347 Thanks to Michael Renner and Phillipe Bruhat.
1348
1349 -Fixed problem where -sot would not stack an opening token followed by
1350 a side comment.  Thanks to Jens Schicke.
1351
1352 -improved breakpoints in complex math and other long statements. Example:
1353 OLD:
1354    return
1355      log($n) + 0.577215664901532 + ( 1 / ( 2 * $n ) ) -
1356      ( 1 / ( 12 * ( $n**2 ) ) ) + ( 1 / ( 120 * ( $n**4 ) ) );
1357 NEW:
1358    return
1359      log($n) + 0.577215664901532 +
1360      ( 1 / ( 2 * $n ) ) -
1361      ( 1 / ( 12 * ( $n**2 ) ) ) +
1362      ( 1 / ( 120 * ( $n**4 ) ) );
1363
1364 -more robust vertical alignment of complex terminal else blocks and ternary
1365 statements.
1366 </code></pre>
1367
1368 <h2>2006 07 19</h2>
1369
1370 <pre><code>-Eliminated bug where a here-doc invoked through an 'e' modifier on a pattern
1371 replacement text was not recognized.  The tokenizer now recursively scans
1372 replacement text (but does not reformat it).
1373
1374 -improved vertical alignment of terminal else blocks and ternary statements.
1375  Thanks to Chris for the suggestion. 
1376
1377  OLD:
1378    if    ( IsBitmap() ) { return GetBitmap(); }
1379    elsif ( IsFiles() )  { return GetFiles(); }
1380    else { return GetText(); }
1381
1382  NEW:
1383    if    ( IsBitmap() ) { return GetBitmap(); }
1384    elsif ( IsFiles() )  { return GetFiles(); }
1385    else                 { return GetText(); }
1386
1387  OLD:
1388    $which_search =
1389        $opts{"t"} ? 'title'
1390      : $opts{"s"} ? 'subject'
1391      : $opts{"a"} ? 'author'
1392      : 'title';
1393
1394  NEW:
1395    $which_search =
1396        $opts{"t"} ? 'title'
1397      : $opts{"s"} ? 'subject'
1398      : $opts{"a"} ? 'author'
1399      :              'title';
1400
1401 -improved indentation of try/catch blocks and other externally defined
1402 functions accepting a block argument.  Thanks to jae.
1403
1404 -Added support for Perl 5.10 features say and smartmatch.
1405
1406 -Added flag -pbp (--perl-best-practices) as an abbreviation for parameters
1407 suggested in Damian Conway's "Perl Best Practices".  -pbp is the same as:
1408
1409    -l=78 -i=4 -ci=4 -st -se -vt=2 -cti=0 -pt=1 -bt=1 -sbt=1 -bbt=1 -nsfs -nolq
1410    -wbb="% + - * / x != == &gt;= &lt;= =~ !~ &lt; &gt; | &amp; &gt;= &lt; = 
1411          **= += *= &amp;= &lt;&lt;= &amp;&amp;= -= /= |= &gt;&gt;= ||= .= %= ^= x="
1412
1413  Please note that the -st here restricts input to standard input; use
1414  -nst if necessary to override.
1415
1416 -Eliminated some needless breaks at equals signs in -lp indentation.
1417
1418    OLD:
1419        $c =
1420          Math::Complex-&gt;make(LEFT + $x * (RIGHT - LEFT) / SIZE,
1421                              TOP + $y * (BOTTOM - TOP) / SIZE);
1422    NEW:
1423        $c = Math::Complex-&gt;make(LEFT + $x * (RIGHT - LEFT) / SIZE,
1424                                 TOP + $y * (BOTTOM - TOP) / SIZE);
1425
1426 A break at an equals is sometimes useful for preventing complex statements 
1427 from hitting the line length limit.  The decision to do this was 
1428 over-eager in some cases and has been improved.  Thanks to Royce Reece.
1429
1430 -qw quotes contained in braces, square brackets, and parens are being
1431 treated more like those containers as far as stacking of tokens.  Also
1432 stack of closing tokens ending ');' will outdent to where the ');' would
1433 have outdented if the closing stack is matched with a similar opening stack.
1434
1435  OLD: perltidy -soc -sct
1436    __PACKAGE__-&gt;load_components(
1437        qw(
1438          PK::Auto
1439          Core
1440          )
1441    );
1442  NEW: perltidy -soc -sct
1443    __PACKAGE__-&gt;load_components( qw(
1444          PK::Auto
1445          Core
1446    ) );
1447  Thanks to Aran Deltac
1448
1449 -Eliminated some undesirable or marginally desirable vertical alignments.
1450 These include terminal colons, opening braces, and equals, and particularly
1451 when just two lines would be aligned.
1452
1453 OLD:
1454    my $accurate_timestamps = $Stamps{lnk};
1455    my $has_link            = 
1456        ...
1457 NEW:
1458    my $accurate_timestamps = $Stamps{lnk};
1459    my $has_link =
1460
1461 -Corrected a problem with -mangle in which a space would be removed
1462 between a keyword and variable beginning with ::.
1463 </code></pre>
1464
1465 <h2>2006 06 14</h2>
1466
1467 <pre><code>-Attribute argument lists are now correctly treated as quoted strings
1468 and not formatted.  This is the most important update in this version.
1469 Thanks to Borris Zentner, Greg Ferguson, Steve Kirkup.
1470
1471 -Updated to recognize the defined or operator, //, to be released in Perl 10.
1472 Thanks to Sebastien Aperghis-Tramoni.
1473
1474 -A useful utility perltidyrc_dump.pl is included in the examples section.  It
1475 will read any perltidyrc file and write it back out in a standard format
1476 (though comments are lost).
1477
1478 -Added option to have perltidy read and return a hash with the contents of a
1479 perltidyrc file.  This may be used by Leif Eriksen's tidyview code.  This
1480 feature is used by the demonstration program 'perltidyrc_dump.pl' in the
1481 examples directory.
1482
1483 -Improved error checking in perltidyrc files.  Unknown bare words were not
1484 being caught.
1485
1486 -The --dump-options parameter now dumps parameters in the format required by a
1487 perltidyrc file.
1488
1489 -V-Strings with underscores are now recognized.
1490 For example: $v = v1.2_3; 
1491
1492 -cti=3 option added which gives one extra indentation level to closing 
1493 tokens always.  This provides more predictable closing token placement
1494 than cti=2.  If you are using cti=2 you might want to try cti=3.
1495
1496 -To identify all left-adjusted comments as static block comments, use C&lt;-sbcp='^#'&gt;.
1497
1498 -New parameters -fs, -fsb, -fse added to allow sections of code between #&lt;&lt;&lt;
1499 and #&gt;&gt;&gt; to be passed through verbatim. This is enabled by default and turned
1500 off by -nfs.  Flags -fsb and -fse allow other beginning and ending markers.
1501 Thanks to Wolfgang Werner and Marion Berryman for suggesting this.  
1502
1503 -added flag -skp to put a space between all Perl keywords and following paren.
1504 The default is to only do this for certain keywords.  Suggested by
1505 H.Merijn Brand.
1506
1507 -added flag -sfp to put a space between a function name and following paren.
1508 The default is not to do this.  Suggested by H.Merijn Brand.
1509
1510 -Added patch to avoid breaking GetOpt::Long::Configure set by calling program. 
1511 Thanks to Philippe Bruhat.
1512
1513 -An error was fixed in which certain parameters in a .perltidyrc file given
1514 without the equals sign were not recognized.  That is,
1515 '--brace-tightness 0' gave an error but '--brace-tightness=0' worked
1516 ok.  Thanks to Zac Hansen.
1517
1518 -An error preventing the -nwrs flag from working was corrected. Thanks to
1519  Greg Ferguson.
1520
1521 -Corrected some alignment problems with entab option.
1522
1523 -A bug with the combination of -lp and -extrude was fixed (though this
1524 combination doesn't really make sense).  The bug was that a line with
1525 a single zero would be dropped.  Thanks to Cameron Hayne.
1526
1527 -Updated Windows detection code to avoid an undefined variable.
1528 Thanks to Joe Yates and Russ Jones.
1529
1530 -Improved formatting for short trailing statements following a closing paren.
1531 Thanks to Joe Matarazzo.
1532
1533 -The handling of the -icb (indent closing block braces) flag has been changed
1534 slightly to provide more consistent and predictable formatting of complex
1535 structures.  Instead of giving a closing block brace the indentation of the
1536 previous line, it is now given one extra indentation level.  The two methods
1537 give the same result if the previous line was a complete statement, as in this
1538 example:
1539
1540        if ($task) {
1541            yyy();
1542            }    # -icb
1543        else {
1544            zzz();
1545            }
1546 The change also fixes a problem with empty blocks such as:
1547
1548    OLD, -icb:
1549    elsif ($debug) {
1550    }
1551
1552    NEW, -icb:
1553    elsif ($debug) {
1554        }
1555
1556 -A problem with -icb was fixed in which a closing brace was misplaced when
1557 it followed a quote which spanned multiple lines.
1558
1559 -Some improved breakpoints for -wba='&amp;&amp; || and or'
1560
1561 -Fixed problem with misaligned cuddled else in complex statements
1562 when the -bar flag was also used.  Thanks to Alex and Royce Reese.
1563
1564 -Corrected documentation to show that --outdent-long-comments is the default.
1565 Thanks to Mario Lia.
1566
1567 -New flag -otr (opening-token-right) is similar to -bar (braces-always-right)
1568 but applies to non-structural opening tokens.
1569
1570 -new flags -sot (stack-opening-token), -sct (stack-closing-token).
1571 Suggested by Tony.
1572 </code></pre>
1573
1574 <h2>2003 10 21</h2>
1575
1576 <pre><code>-The default has been changed to not do syntax checking with perl.  
1577   Use -syn if you want it.  Perltidy is very robust now, and the -syn
1578   flag now causes more problems than it's worth because of BEGIN blocks
1579   (which get executed with perl -c).  For example, perltidy will never
1580   return when trying to beautify this code if -syn is used:
1581
1582        BEGIN { 1 while { }; }
1583
1584  Although this is an obvious error, perltidy is often run on untested
1585  code which is more likely to have this sort of problem.  A more subtle
1586  example is:
1587
1588        BEGIN { use FindBin; }
1589
1590  which may hang on some systems using -syn if a shared file system is
1591  unavailable.
1592
1593 -Changed style -gnu to use -cti=1 instead of -cti=2 (see next item).
1594  In most cases it looks better.  To recover the previous format, use
1595  '-gnu -cti=2'
1596
1597 -Added flags -cti=n for finer control of closing token indentation.
1598   -cti = 0 no extra indentation (default; same as -nicp)
1599   -cti = 1 enough indentation so that the closing token
1600        aligns with its opening token.
1601   -cti = 2 one extra indentation level if the line has the form 
1602          );   ];   or   };     (same as -icp).
1603
1604   The new option -cti=1 works well with -lp:
1605
1606   EXAMPLES:
1607
1608    # perltidy -lp -cti=1
1609    @month_of_year = (
1610                       'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
1611                       'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'
1612                     );
1613
1614    # perltidy -lp -cti=2
1615    @month_of_year = (
1616                       'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
1617                       'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'
1618                       );
1619  This is backwards compatible with -icp. See revised manual for
1620  details.  Suggested by Mike Pennington.
1621
1622 -Added flag '--preserve-line-endings' or '-ple' to cause the output
1623  line ending to be the same as in the input file, for unix, dos, 
1624  or mac line endings.  Only works under unix. Suggested by 
1625  Rainer Hochschild.
1626
1627 -Added flag '--output-line-ending=s' or '-ole=s' where s=dos or win,
1628  unix, or mac.  Only works under unix.
1629
1630 -Files with Mac line endings should now be handled properly under unix
1631  and dos without being passed through a converter.
1632
1633 -You may now include 'and', 'or', and 'xor' in the list following
1634  '--want-break-after' to get line breaks after those keywords rather than
1635  before them.  Suggested by Rainer Hochschild.
1636
1637 -Corrected problem with command line option for -vtc=n and -vt=n. The
1638  equals sign was being eaten up by the Windows shell so perltidy didn't
1639  see it.
1640 </code></pre>
1641
1642 <h2>2003 07 26</h2>
1643
1644 <pre><code>-Corrected cause of warning message with recent versions of Perl:
1645    "Possible precedence problem on bitwise &amp; operator at ..."
1646  Thanks to Jim Files.
1647
1648 -fixed bug with -html with '=for pod2html' sections, in which code/pod
1649 output order was incorrect.  Thanks to Tassilo von Parseval.
1650
1651 -fixed bug when the -html flag is used, in which the following error
1652 message, plus others, appear:
1653     did not see &lt;body&gt; in pod2html output
1654 This was caused by a change in the format of html output by pod2html
1655 VERSION 1.04 (included with perl 5.8).  Thanks to Tassilo von Parseval.
1656
1657 -Fixed bug where an __END__ statement would be mistaken for a label
1658 if it is immediately followed by a line with a leading colon. Thanks
1659 to John Bayes.
1660
1661 -Implemented guessing logic for brace types when it is ambiguous.  This
1662 has been on the TODO list a long time.  Thanks to Boris Zentner for
1663 an example.
1664
1665 -Long options may now be negated either as '--nolong-option' 
1666 or '--no-long-option'.  Thanks to Philip Newton for the suggestion.
1667
1668 -added flag --html-entities or -hent which controls the use of
1669 Html::Entities for html formatting.  Use --nohtml-entities or -nhent to
1670 prevent the use of Html::Entities to encode special symbols.  The
1671 default is -hent.  Html::Entities when formatting perl text to escape
1672 special symbols.  This may or may not be the right thing to do,
1673 depending on browser/language combinations.  Thanks to Burak Gursoy for
1674 this suggestion.
1675
1676 -Bareword strings with leading '-', like, '-foo' now count as 1 token
1677 for horizontal tightness.  This way $a{'-foo'}, $a{foo}, and $a{-foo}
1678 are now all treated similarly.  Thus, by default, OLD: $a{ -foo } will
1679 now be NEW: $a{-foo}.  Suggested by Mark Olesen.
1680
1681 -added 2 new flags to control spaces between keywords and opening parens:
1682   -sak=s  or --space-after-keyword=s,  and
1683   -nsak=s or --nospace-after-keyword=s, where 's' is a list of keywords.
1684
1685 The new default list of keywords which get a space is:
1686
1687   "my local our and or eq ne if else elsif until unless while for foreach
1688     return switch case given when"
1689
1690 Use -sak=s and -nsak=s to add and remove keywords from this list,
1691    respectively.
1692
1693 Explanation: Stephen Hildrey noted that perltidy was being inconsistent
1694 in placing spaces between keywords and opening parens, and sent a patch
1695 to give user control over this.  The above list was selected as being
1696 a reasonable default keyword list.  Previously, perltidy
1697 had a hardwired list which also included these keywords:
1698
1699        push pop shift unshift join split die
1700
1701 but did not have 'our'.  Example: if you prefer to make perltidy behave
1702 exactly as before, you can include the following two lines in your
1703 .perltidyrc file: 
1704
1705   -sak="push pop local shift unshift join split die"
1706   -nsak="our"
1707
1708 -Corrected html error in .toc file when -frm -html is used (extra ");
1709  browsers were tolerant of it.
1710
1711 -Improved alignment of chains of binary and ?/: operators. Example:
1712  OLD:
1713    $leapyear =
1714      $year % 4     ? 0
1715      : $year % 100 ? 1
1716      : $year % 400 ? 0
1717      : 1;
1718  NEW:
1719    $leapyear =
1720        $year % 4   ? 0
1721      : $year % 100 ? 1
1722      : $year % 400 ? 0
1723      : 1;
1724
1725 -improved breakpoint choices involving '-&gt;'
1726
1727 -Corrected tokenization of things like ${#}. For example,
1728  ${#} is valid, but ${# } is a syntax error.
1729
1730 -Corrected minor tokenization errors with indirect object notation.
1731  For example, 'new A::()' works now.
1732
1733 -Minor tokenization improvements; all perl code distributed with perl 5.8 
1734  seems to be parsed correctly except for one instance (lextest.t) 
1735  of the known bug.
1736 </code></pre>
1737
1738 <h2>2002 11 30</h2>
1739
1740 <pre><code>-Implemented scalar attributes.  Thanks to Sean Tobin for noting this.
1741
1742 -Fixed glitch introduced in previous release where -pre option
1743 was not outputting a leading html &lt;pre&gt; tag.
1744
1745 -Numerous minor improvements in vertical alignment, including the following:
1746
1747 -Improved alignment of opening braces in many cases.  Needed for improved
1748 switch/case formatting, and also suggested by Mark Olesen for sort/map/grep
1749 formatting.  For example:
1750
1751  OLD:
1752    @modified =
1753      map { $_-&gt;[0] }
1754      sort { $a-&gt;[1] &lt;=&gt; $b-&gt;[1] }
1755      map { [ $_, -M ] } @filenames;
1756
1757  NEW:
1758    @modified =
1759      map  { $_-&gt;[0] }
1760      sort { $a-&gt;[1] &lt;=&gt; $b-&gt;[1] }
1761      map  { [ $_, -M ] } @filenames;
1762
1763 -Eliminated alignments across unrelated statements. Example:
1764  OLD:
1765    $borrowerinfo-&gt;configure( -state =&gt; 'disabled' );
1766    $borrowerinfo-&gt;grid( -col        =&gt; 1, -row =&gt; 0, -sticky =&gt; 'w' );
1767
1768  NEW:  
1769    $borrowerinfo-&gt;configure( -state =&gt; 'disabled' );
1770    $borrowerinfo-&gt;grid( -col =&gt; 1, -row =&gt; 0, -sticky =&gt; 'w' );
1771
1772  Thanks to Mark Olesen for suggesting this.
1773
1774 -Improved alignement of '='s in certain cases.
1775  Thanks to Norbert Gruener for sending an example.
1776
1777 -Outdent-long-comments (-olc) has been re-instated as a default, since
1778  it works much better now.  Use -nolc if you want to prevent it.
1779
1780 -Added check for 'perltidy file.pl -o file.pl', which causes file.pl
1781 to be lost. (The -b option should be used instead). Thanks to mreister
1782 for reporting this problem.
1783 </code></pre>
1784
1785 <h2>2002 11 06</h2>
1786
1787 <pre><code>-Switch/case or given/when syntax is now recognized.  Its vertical alignment
1788 is not great yet, but it parses ok.  The words 'switch', 'case', 'given',
1789 and 'when' are now treated as keywords.  If this causes trouble with older
1790 code, we could introduce a switch to deactivate it.  Thanks to Stan Brown
1791 and Jochen Schneider for recommending this.
1792
1793 -Corrected error parsing sub attributes with call parameters.
1794 Thanks to Marc Kerr for catching this.
1795
1796 -Sub prototypes no longer need to be on the same line as sub names.  
1797
1798 -a new flag -frm or --frames will cause html output to be in a
1799 frame, with table of contents in the left panel and formatted source
1800 in the right panel.  Try 'perltidy -html -frm somemodule.pm' for example.
1801
1802 -The new default for -html formatting is to pass the pod through Pod::Html.
1803 The result is syntax colored code within your pod documents. This can be
1804 deactivated with -npod.  Thanks to those who have written to discuss this,
1805 particularly Mark Olesen and Hugh Myers.
1806
1807 -the -olc (--outdent-long-comments) option works much better.  It now outdents
1808 groups of consecutive comments together, and by just the amount needed to
1809 avoid having any one line exceeding the maximum line length.
1810
1811 -block comments are now trimmed of trailing whitespace.
1812
1813 -if a directory specified with -opath does not exist, it will be created.
1814
1815 -a table of contents to packages and subs is output when -html is used.
1816 Use -ntoc to prevent this. 
1817
1818 -fixed an unusual bug in which a 'for' statement following a 'format'
1819 statement was not correctly tokenized.  Thanks to Boris Zentner for
1820 catching this.
1821
1822 -Tidy.pm is no longer dependent on modules IO::Scalar and IO::ScalarArray.  
1823 There were some speed issues.  Suggested by Joerg Walter.
1824
1825 -The treatment of quoted wildcards (file globs) is now system-independent. 
1826 For example
1827
1828    perltidy 'b*x.p[lm]'
1829
1830 would match box.pl, box.pm, brinx.pm under any operating system.  Of
1831 course, anything unquoted will be subject to expansion by any shell.
1832
1833 -default color for keywords under -html changed from 
1834 SaddleBrown (#8B4513) to magenta4 (#8B008B).
1835
1836 -fixed an arg parsing glitch in which something like:
1837   perltidy quick-help
1838 would trigger the help message and exit, rather than operate on the
1839 file 'quick-help'.
1840 </code></pre>
1841
1842 <h2>2002 09 22</h2>
1843
1844 <pre><code>-New option '-b' or '--backup-and-modify-in-place' will cause perltidy to
1845 overwrite the original file with the tidied output file.  The original
1846 file will be saved with a '.bak' extension (which can be changed with
1847 -bext=s).  Thanks to Rudi Farkas for the suggestion.
1848
1849 -An index to all subs is included at the top of -html output, unless
1850 only the &lt;pre&gt; section is written.
1851
1852 -Anchor lines of the form &lt;a name="mysub"&gt;&lt;/a&gt; are now inserted at key points
1853 in html output, such as before sub definitions, for the convenience of
1854 postprocessing scripts.  Suggested by Howard Owen.
1855
1856 -The cuddled-else (-ce) flag now also makes cuddled continues, like
1857 this:
1858
1859    while ( ( $pack, $file, $line ) = caller( $i++ ) ) {
1860       # bla bla
1861    } continue {
1862        $prevpack = $pack;
1863    }
1864
1865 Suggested by Simon Perreault.  
1866
1867 -Fixed bug in which an extra blank line was added before an =head or 
1868 similar pod line after an __END__ or __DATA__ line each time 
1869 perltidy was run.  Also, an extra blank was being added after
1870 a terminal =cut.  Thanks to Mike Birdsall for reporting this.
1871 </code></pre>
1872
1873 <h2>2002 08 26</h2>
1874
1875 <pre><code>-Fixed bug in which space was inserted in a hyphenated hash key:
1876    my $val = $myhash{USER-NAME};
1877  was converted to:
1878    my $val = $myhash{USER -NAME}; 
1879  Thanks to an anonymous bug reporter at sourceforge.
1880
1881 -Fixed problem with the '-io' ('--indent-only') where all lines 
1882  were double spaced.  Thanks to Nick Andrew for reporting this bug.
1883
1884 -Fixed tokenization error in which something like '-e1' was 
1885  parsed as a number. 
1886
1887 -Corrected a rare problem involving older perl versions, in which 
1888  a line break before a bareword caused problems with 'use strict'.
1889  Thanks to Wolfgang Weisselberg for noting this.
1890
1891 -More syntax error checking added.
1892
1893 -Outdenting labels (-ola) has been made the default, in order to follow the
1894  perlstyle guidelines better.  It's probably a good idea in general, but
1895  if you do not want this, use -nola in your .perltidyrc file.
1896
1897 -Updated rules for padding logical expressions to include more cases.
1898  Thanks to Wolfgang Weisselberg for helpful discussions.
1899
1900 -Added new flag -osbc (--outdent-static-block-comments) which will
1901  outdent static block comments by 2 spaces (or whatever -ci equals).
1902  Requested by Jon Robison.
1903 </code></pre>
1904
1905 <h2>2002 04 25</h2>
1906
1907 <pre><code>-Corrected a bug, introduced in the previous release, in which some
1908  closing side comments (-csc) could have incorrect text.  This is
1909  annoying but will be correct the next time perltidy is run with -csc.
1910
1911 -Fixed bug where whitespace was being removed between 'Bar' and '()' 
1912  in a use statement like:
1913
1914       use Foo::Bar ();
1915
1916 -Whenever possible, if a logical expression is broken with leading
1917  '&amp;&amp;', '||', 'and', or 'or', then the leading line will be padded
1918  with additional space to produce alignment.  This has been on the
1919  todo list for a long time; thanks to Frank Steinhauer for reminding
1920  me to do it.  Notice the first line after the open parens here:
1921
1922        OLD: perltidy -lp
1923        if (
1924             !param("rules.to.$linecount")
1925             &amp;&amp; !param("rules.from.$linecount")
1926             &amp;&amp; !param("rules.subject.$linecount")
1927             &amp;&amp; !(
1928                   param("rules.fieldname.$linecount")
1929                   &amp;&amp; param("rules.fieldval.$linecount")
1930             )
1931             &amp;&amp; !param("rules.size.$linecount")
1932             &amp;&amp; !param("rules.custom.$linecount")
1933          )
1934
1935        NEW: perltidy -lp
1936        if (
1937                !param("rules.to.$linecount")
1938             &amp;&amp; !param("rules.from.$linecount")
1939             &amp;&amp; !param("rules.subject.$linecount")
1940             &amp;&amp; !(
1941                      param("rules.fieldname.$linecount")
1942                   &amp;&amp; param("rules.fieldval.$linecount")
1943             )
1944             &amp;&amp; !param("rules.size.$linecount")
1945             &amp;&amp; !param("rules.custom.$linecount")
1946          )
1947 </code></pre>
1948
1949 <h2>2002 04 16</h2>
1950
1951 <pre><code>-Corrected a mistokenization of variables for a package with a name
1952  equal to a perl keyword.  For example: 
1953
1954     my::qx();
1955     package my;
1956     sub qx{print "Hello from my::qx\n";}
1957
1958  In this case, the leading 'my' was mistokenized as a keyword, and a
1959  space was being place between 'my' and '::'.  This has been
1960  corrected.  Thanks to Martin Sluka for discovering this. 
1961
1962 -A new flag -bol (--break-at-old-logic-breakpoints)
1963  has been added to control whether containers with logical expressions
1964  should be broken open.  This is the default.
1965
1966 -A new flag -bok (--break-at-old-keyword-breakpoints)
1967  has been added to follow breaks at old keywords which return lists,
1968  such as sort and map.  This is the default.
1969
1970 -A new flag -bot (--break-at-old-trinary-breakpoints) has been added to
1971  follow breaks at trinary (conditional) operators.  This is the default.
1972
1973 -A new flag -cab=n has been added to control breaks at commas after
1974  '=&gt;' tokens.  The default is n=1, meaning break unless this breaks
1975  open an existing on-line container.
1976
1977 -A new flag -boc has been added to allow existing list formatting
1978  to be retained.  (--break-at-old-comma-breakpoints).  See updated manual.
1979
1980 -A new flag -iob (--ignore-old-breakpoints) has been added to
1981  prevent the locations of old breakpoints from influencing the output
1982  format.
1983
1984 -Corrected problem where nested parentheses were not getting full
1985  indentation.  This has been on the todo list for some time; thanks 
1986  to Axel Rose for a snippet demonstrating this issue.
1987
1988            OLD: inner list is not indented
1989            $this-&gt;sendnumeric(
1990                $this-&gt;server,
1991                (
1992                  $ret-&gt;name,        $user-&gt;username, $user-&gt;host,
1993                $user-&gt;server-&gt;name, $user-&gt;nick,     "H"
1994                ),
1995            );
1996
1997            NEW:
1998            $this-&gt;sendnumeric(
1999                $this-&gt;server,
2000                (
2001                    $ret-&gt;name,          $user-&gt;username, $user-&gt;host,
2002                    $user-&gt;server-&gt;name, $user-&gt;nick,     "H"
2003                ),
2004            );
2005
2006 -Code cleaned up by removing the following unused, undocumented flags.
2007  They should not be in any .perltidyrc files because they were just
2008  experimental flags which were never documented.  Most of them placed
2009  artificial limits on spaces, and Wolfgang Weisselberg convinced me that
2010  most of them they do more harm than good by causing unexpected results.
2011
2012  --maximum-continuation-indentation (-mci)
2013  --maximum-whitespace-columns
2014  --maximum-space-to-comment (-xsc)
2015  --big-space-jump (-bsj)
2016
2017 -Pod file 'perltidy.pod' has been appended to the script 'perltidy', and
2018  Tidy.pod has been append to the module 'Tidy.pm'.  Older MakeMaker's
2019  were having trouble.
2020
2021 -A new flag -isbc has been added for more control on comments. This flag
2022  has the effect that if there is no leading space on the line, then the
2023  comment will not be indented, and otherwise it may be.  If both -ibc and
2024  -isbc are set, then -isbc takes priority.  Thanks to Frank Steinhauer
2025  for suggesting this.
2026
2027 -A new document 'stylekey.pod' has been created to quickly guide new users
2028  through the maze of perltidy style parameters.  An html version is 
2029  on the perltidy web page.  Take a look! It should be very helpful.
2030
2031 -Parameters for controlling 'vertical tightness' have been added:
2032  -vt and -vtc are the main controls, but finer control is provided
2033  with -pvt, -pcvt, -bvt, -bcvt, -sbvt, -sbcvt.  Block brace vertical
2034  tightness controls have also been added.
2035  See updated manual and also see 'stylekey.pod'. Simple examples:
2036
2037    # perltidy -lp -vt=1 -vtc=1
2038    @month_of_year = ( 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
2039                       'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec' );
2040
2041    # perltidy -lp -vt=1 -vtc=0
2042    @month_of_year = ( 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
2043                       'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'
2044    );
2045
2046 -Lists which do not format well in uniform columns are now better
2047  identified and formated.
2048
2049    OLD:
2050    return $c-&gt;create( 'polygon', $x, $y, $x + $ruler_info{'size'},
2051        $y + $ruler_info{'size'}, $x - $ruler_info{'size'},
2052        $y + $ruler_info{'size'} );
2053
2054    NEW:
2055    return $c-&gt;create(
2056        'polygon', $x, $y,
2057        $x + $ruler_info{'size'},
2058        $y + $ruler_info{'size'},
2059        $x - $ruler_info{'size'},
2060        $y + $ruler_info{'size'}
2061    );
2062
2063    OLD:
2064      radlablist($f1, pad('Initial', $p), $b-&gt;{Init}-&gt;get_panel_ref, 'None ',
2065                 'None', 'Default', 'Default', 'Simple', 'Simple');
2066    NEW:
2067      radlablist($f1,
2068                 pad('Initial', $p),
2069                 $b-&gt;{Init}-&gt;get_panel_ref,
2070                 'None ', 'None', 'Default', 'Default', 'Simple', 'Simple');
2071
2072 -Corrected problem where an incorrect html filename was generated for 
2073  external calls to Tidy.pm module.  Fixed incorrect html title when
2074  Tidy.pm is called with IO::Scalar or IO::Array source.
2075
2076 -Output file permissons are now set as follows.  An output script file
2077  gets the same permission as the input file, except that owner
2078  read/write permission is added (otherwise, perltidy could not be
2079  rerun).  Html output files use system defaults.  Previously chmod 0755
2080  was used in all cases.  Thanks to Mark Olesen for bringing this up.
2081
2082 -Missing semicolons will not be added in multi-line blocks of type
2083  sort, map, or grep.  This brings perltidy into closer agreement
2084  with common practice.  Of course, you can still put semicolons 
2085  there if you like.  Thanks to Simon Perreault for a discussion of this.
2086
2087 -Most instances of extra semicolons are now deleted.  This is
2088  particularly important if the -csc option is used.  Thanks to Wolfgang
2089  Weisselberg for noting this.  For example, the following line
2090  (produced by 'h2xs' :) has an extra semicolon which will now be
2091  removed:
2092
2093     BEGIN { plan tests =&gt; 1 };
2094
2095 -New parameter -csce (--closing-side-comment-else-flag) can be used
2096  to control what text is appended to 'else' and 'elsif' blocks.
2097  Default is to just add leading 'if' text to an 'else'.  See manual.
2098
2099 -The -csc option now labels 'else' blocks with additinal information
2100  from the opening if statement and elsif statements, if space.
2101  Thanks to Wolfgang Weisselberg for suggesting this.
2102
2103 -The -csc option will now remove any old closing side comments
2104  below the line interval threshold. Thanks to Wolfgang Weisselberg for
2105  suggesting this.
2106
2107 -The abbreviation feature, which was broken in the previous version,
2108  is now fixed.  Thanks to Michael Cartmell for noting this.
2109
2110 -Vertical alignment is now done for '||='  .. somehow this was 
2111  overlooked.
2112 </code></pre>
2113
2114 <h2>2002 02 25</h2>
2115
2116 <pre><code>-This version uses modules for the first time, and a standard perl
2117  Makefile.PL has been supplied.  However, perltidy may still be
2118  installed as a single script, without modules.  See INSTALL for
2119  details.
2120
2121 -The man page 'perl2web' has been merged back into the main 'perltidy'
2122  man page to simplify installation.  So you may remove that man page
2123  if you have an older installation.
2124
2125 -Added patch from Axel Rose for MacPerl.  The patch prompts the user
2126  for command line arguments before calling the module 
2127  Perl::Tidy::perltidy.
2128
2129 -Corrected bug with '-bar' which was introduced in the previous
2130  version.  A closing block brace was being indented.  Thanks to
2131  Alexandros M Manoussakis for reporting this.
2132
2133 -New parameter '--entab-leading-whitespace=n', or '-et=n', has been
2134  added for those who prefer tabs.  This behaves different from the
2135  existing '-t' parameter; see updated man page.  Suggested by Mark
2136  Olesen.
2137
2138 -New parameter '--perl-syntax-check-flags=s'  or '-pcsf=s' can be
2139  used to change the flags passed to perltidy in a syntax check.
2140  See updated man page.  Suggested by Mark Olesen. 
2141
2142 -New parameter '--output-path=s'  or '-opath=s' will cause output
2143  files to be placed in directory s.  See updated man page.  Thanks for
2144  Mark Olesen for suggesting this.
2145
2146 -New parameter --dump-profile (or -dpro) will dump to
2147  standard output information about the search for a
2148  configuration file, the name of whatever configuration file
2149  is selected, and its contents.  This should help debugging
2150  config files, especially on different Windows systems.
2151
2152 -The -w parameter now notes possible errors of the form:
2153
2154        $comment = s/^\s*(\S+)\..*/$1/;   # trim whitespace
2155
2156 -Corrections added for a leading ':' and for leaving a leading 'tcsh'
2157  line untouched.  Mark Olesen reported that lines of this form were
2158  accepted by perl but not by perltidy:
2159
2160        : # use -*- perl -*-
2161        eval 'exec perl -wS $0 "$@"'  # shell should exec 'perl'
2162        unless 1;                     # but Perl should skip this one
2163
2164  Perl will silently swallow a leading colon on line 1 of a
2165  script, and now perltidy will do likewise.  For example,
2166  this is a valid script, provided that it is the first line,
2167  but not otherwise:
2168
2169        : print "Hello World\n";
2170
2171  Also, perltidy will now mark a first line with leading ':' followed by
2172  '#' as type SYSTEM (just as a #!  line), not to be formatted.
2173
2174 -List formatting improved for certain lists with special
2175  initial terms, such as occur with 'printf', 'sprintf',
2176  'push', 'pack', 'join', 'chmod'.  The special initial term is
2177  now placed on a line by itself.  For example, perltidy -gnu
2178
2179     OLD:
2180        $Addr = pack(
2181                     "C4",                hex($SourceAddr[0]),
2182                     hex($SourceAddr[1]), hex($SourceAddr[2]),
2183                     hex($SourceAddr[3])
2184                     );
2185
2186     NEW:
2187        $Addr = pack("C4",
2188                     hex($SourceAddr[0]), hex($SourceAddr[1]),
2189                     hex($SourceAddr[2]), hex($SourceAddr[3]));
2190
2191      OLD:
2192            push (
2193                  @{$$self{states}}, '64', '66', '68',
2194                  '70',              '72', '74', '76',
2195                  '78',              '80', '82', '84',
2196                  '86',              '88', '90', '92',
2197                  '94',              '96', '98', '100',
2198                  '102',             '104'
2199                  );
2200
2201      NEW:
2202            push (
2203                  @{$$self{states}},
2204                  '64', '66', '68', '70', '72',  '74',  '76',
2205                  '78', '80', '82', '84', '86',  '88',  '90',
2206                  '92', '94', '96', '98', '100', '102', '104'
2207                  );
2208
2209 -Lists of complex items, such as matricies, are now detected
2210  and displayed with just one item per row:
2211
2212    OLD:
2213    $this-&gt;{'CURRENT'}{'gfx'}{'MatrixSkew'} = Text::PDF::API::Matrix-&gt;new(
2214        [ 1, tan( deg2rad($a) ), 0 ], [ tan( deg2rad($b) ), 1, 0 ],
2215        [ 0, 0, 1 ]
2216    );
2217
2218    NEW:
2219    $this-&gt;{'CURRENT'}{'gfx'}{'MatrixSkew'} = Text::PDF::API::Matrix-&gt;new(
2220        [ 1,                  tan( deg2rad($a) ), 0 ],
2221        [ tan( deg2rad($b) ), 1,                  0 ],
2222        [ 0,                  0,                  1 ]
2223    );
2224
2225 -The perl syntax check will be turned off for now when input is from
2226  standard input or standard output.  The reason is that this requires
2227  temporary files, which has produced far too many problems during
2228  Windows testing.  For example, the POSIX module under Windows XP/2000
2229  creates temporary names in the root directory, to which only the
2230  administrator should have permission to write.
2231
2232 -Merged patch sent by Yves Orton to handle appropriate
2233  configuration file locations for different Windows varieties
2234  (2000, NT, Me, XP, 95, 98).
2235
2236 -Added patch to properly handle a for/foreach loop without
2237  parens around a list represented as a qw.  I didn't know this
2238  was possible until Wolfgang Weisselberg pointed it out:
2239
2240        foreach my $key qw\Uno Due Tres Quadro\ {
2241            print "Set $key\n";
2242        }
2243
2244  But Perl will give a syntax error without the $ variable; ie this will
2245  not work:
2246
2247        foreach qw\Uno Due Tres Quadro\ {
2248            print "Set $_\n";
2249        }
2250
2251 -Merged Windows version detection code sent by Yves Orton.  Perltidy
2252  now automatically turns off syntax checking for Win 9x/ME versions,
2253  and this has solved a lot of robustness problems.  These systems 
2254  cannot reliably handle backtick operators.  See man page for
2255  details.
2256
2257 -Merged VMS filename handling patch sent by Michael Cartmell.  (Invalid
2258  output filenames were being created in some cases). 
2259
2260 -Numerous minor improvements have been made for -lp style indentation.
2261
2262 -Long C-style 'for' expressions will be broken after each ';'.   
2263
2264  'perltidy -gnu' gives:
2265
2266    OLD:
2267    for ($status = $db-&gt;seq($key, $value, R_CURSOR()) ; $status == 0
2268         and $key eq $origkey ; $status = $db-&gt;seq($key, $value, R_NEXT())) 
2269
2270    NEW:
2271    for ($status = $db-&gt;seq($key, $value, R_CURSOR()) ;
2272         $status == 0 and $key eq $origkey ;
2273         $status = $db-&gt;seq($key, $value, R_NEXT()))
2274
2275 -For the -lp option, a single long term within parens
2276  (without commas) now has better alignment.  For example,
2277  perltidy -gnu
2278
2279            OLD:
2280            $self-&gt;throw("Must specify a known host, not $location,"
2281                  . " possible values ("
2282                  . join (",", sort keys %hosts) . ")");
2283
2284            NEW:
2285            $self-&gt;throw("Must specify a known host, not $location,"
2286                         . " possible values ("
2287                         . join (",", sort keys %hosts) . ")");
2288 </code></pre>
2289
2290 <h2>2001 12 31</h2>
2291
2292 <pre><code>-This version is about 20 percent faster than the previous
2293  version as a result of optimization work.  The largest gain
2294  came from switching to a dispatch hash table in the
2295  tokenizer.
2296
2297 -perltidy -html will check to see if HTML::Entities is
2298  installed, and if so, it will use it to encode unsafe
2299  characters.
2300
2301 -Added flag -oext=ext to change the output file extension to
2302  be different from the default ('tdy' or 'html').  For
2303  example:
2304
2305    perltidy -html -oext=htm filename
2306
2307 will produce filename.htm
2308
2309 -Added flag -cscw to issue warnings if a closing side comment would replace
2310 an existing, different side comments.  See the man page for details.
2311 Thanks to Peter Masiar for helpful discussions.
2312
2313 -Corrected tokenization error of signed hex/octal/binary numbers. For
2314 example, the first hex number below would have been parsed correctly
2315 but the second one was not:
2316    if ( ( $tmp &gt;= 0x80_00_00 ) || ( $tmp &lt; -0x80_00_00 ) ) { }
2317
2318 -'**=' was incorrectly tokenized as '**' and '='.  This only
2319     caused a problem with the -extrude opton.
2320
2321 -Corrected a divide by zero when -extrude option is used
2322
2323 -The flag -w will now contain all errors reported by 'perl -c' on the
2324 input file, but otherwise they are not reported.  The reason is that
2325 perl will report lots of problems and syntax errors which are not of
2326 interest when only a small snippet is being formatted (such as missing
2327 modules and unknown bare words).  Perltidy will always report all
2328 significant syntax errors that it finds, such as unbalanced braces,
2329 unless the -q (quiet) flag is set.
2330
2331 -Merged modifications created by Hugh Myers into perltidy.
2332  These include a 'streamhandle' routine which allows perltidy
2333  as a module to operate on input and output arrays and strings
2334  in addition to files.  Documentation and new packaging as a
2335  module should be ready early next year; This is an elegant,
2336  powerful update; many thanks to Hugh for contributing it.
2337 </code></pre>
2338
2339 <h2>2001 11 28</h2>
2340
2341 <pre><code>-added a tentative patch which tries to keep any existing breakpoints
2342 at lines with leading keywords map,sort,eval,grep. The idea is to
2343 improve formatting of sequences of list operations, as in a schwartzian
2344 transform.  Example:
2345
2346    INPUT:
2347    my @sorted = map { $_-&gt;[0] }
2348                 sort { $a-&gt;[1] &lt;=&gt; $b-&gt;[1] }
2349                 map { [ $_, rand ] } @list;
2350
2351    OLD:
2352    my @sorted =
2353      map { $_-&gt;[0] } sort { $a-&gt;[1] &lt;=&gt; $b-&gt;[1] } map { [ $_, rand ] } @list;
2354
2355    NEW:
2356    my @sorted = map { $_-&gt;[0] }
2357      sort { $a-&gt;[1] &lt;=&gt; $b-&gt;[1] }
2358      map { [ $_, rand ] } @list;
2359
2360  The new alignment is not as nice as the input, but this is an improvement.
2361  Thanks to Yves Orton for this suggestion.
2362
2363 -modified indentation logic so that a line with leading opening paren,
2364 brace, or square bracket will never have less indentation than the
2365 line with the corresponding opening token.  Here's a simple example:
2366
2367    OLD:
2368        $mw-&gt;Button(
2369            -text    =&gt; "New Document",
2370            -command =&gt; \&amp;new_document
2371          )-&gt;pack(
2372            -side   =&gt; 'bottom',
2373            -anchor =&gt; 'e'
2374        );
2375
2376    Note how the closing ');' is lined up with the first line, even
2377    though it closes a paren in the 'pack' line.  That seems wrong.
2378
2379    NEW:
2380        $mw-&gt;Button(
2381            -text    =&gt; "New Document",
2382            -command =&gt; \&amp;new_document
2383          )-&gt;pack(
2384            -side   =&gt; 'bottom',
2385            -anchor =&gt; 'e'
2386          );
2387
2388   This seems nicer: you can up-arrow with an editor and arrive at the
2389   opening 'pack' line.
2390
2391 -corrected minor glitch in which cuddled else (-ce) did not get applied
2392 to an 'unless' block, which should look like this:
2393
2394        unless ($test) {
2395
2396        } else {
2397
2398        }
2399
2400  Thanks to Jeremy Mates for reporting this.
2401
2402 -The man page has been reorganized to parameters easier to find.
2403
2404 -Added check for multiple definitions of same subroutine.  It is easy
2405  to introduce this problem when cutting and pasting. Perl does not
2406  complain about it, but it can lead to disaster.
2407
2408 -The command -pro=filename  or -profile=filename may be used to specify a
2409  configuration file which will override the default name of .perltidyrc.
2410  There must not be a space on either side of the '=' sign.  I needed
2411  this to be able to easily test perltidy with a variety of different
2412  configuration files.
2413
2414 -Side comment alignment has been improved somewhat across frequent level
2415  changes, as in short if/else blocks.  Thanks to Wolfgang Weisselberg 
2416  for pointing out this problem.  For example:
2417
2418    OLD:
2419    if ( ref $self ) {    # Called as a method
2420        $format = shift;
2421    }
2422    else {    # Regular procedure call
2423        $format = $self;
2424        undef $self;
2425    }
2426
2427    NEW:
2428    if ( ref $self ) {    # Called as a method
2429        $format = shift;
2430    }
2431    else {                # Regular procedure call
2432        $format = $self;
2433        undef $self;
2434    }
2435
2436 -New command -ssc (--static-side-comment) and related command allows
2437  side comments to be spaced close to preceding character.  This is
2438  useful for displaying commented code as side comments.
2439
2440 -New command -csc (--closing-side-comment) and several related
2441  commands allow comments to be added to (and deleted from) any or all
2442  closing block braces.  This can be useful if you have to maintain large
2443  programs, especially those that you didn't write.  See updated man page.
2444  Thanks to Peter Masiar for this suggestion.  For a simple example:
2445
2446        perltidy -csc
2447
2448        sub foo {
2449            if ( !defined( $_[0] ) ) {
2450                print("Hello, World\n");
2451            }
2452            else {
2453                print( $_[0], "\n" );
2454            }
2455        } ## end sub foo
2456
2457  This added '## end sub foo' to the closing brace.  
2458  To remove it, perltidy -ncsc.
2459
2460 -New commands -ola, for outdenting labels, and -okw, for outdenting
2461  selected control keywords, were implemented.  See the perltidy man
2462  page for details.  Thanks to Peter Masiar for this suggestion.
2463
2464 -Hanging side comment change: a comment will not be considered to be a
2465  hanging side comment if there is no leading whitespace on the line.
2466  This should improve the reliability of identifying hanging side comments.
2467  Thanks to Peter Masiar for this suggestion.
2468
2469 -Two new commands for outdenting, -olq (outdent-long-quotes) and -olc
2470  (outdent-long-comments), have been added.  The original -oll
2471  (outdent-long-lines) remains, and now is an abbreviation for -olq and -olc.
2472  The new default is just -olq.  This was necessary to avoid inconsistency with
2473  the new static block comment option.
2474
2475 -Static block comments:  to provide a way to display commented code
2476  better, the convention is used that comments with a leading '##' should
2477  not be formatted as usual.  Please see '-sbc' (or '--static-block-comment')
2478  for documentation.  It can be deactivated with with -nsbc, but
2479  should not normally be necessary. Thanks to Peter Masiar for this 
2480  suggestion.
2481
2482 -Two changes were made to help show structure of complex lists:
2483  (1) breakpoints are forced after every ',' in a list where any of
2484  the list items spans multiple lines, and
2485  (2) List items which span multiple lines now get continuation indentation.
2486
2487  The following example illustrates both of these points.  Many thanks to
2488  Wolfgang Weisselberg for this snippet and a discussion of it; this is a
2489  significant formatting improvement. Note how it is easier to see the call
2490  parameters in the NEW version:
2491
2492    OLD:
2493    assert( __LINE__, ( not defined $check )
2494        or ref $check
2495        or $check eq "new"
2496        or $check eq "old", "Error in parameters",
2497        defined $old_new ? ( ref $old_new ? ref $old_new : $old_new ) : "undef",
2498        defined $db_new  ? ( ref $db_new  ? ref $db_new  : $db_new )  : "undef",
2499        defined $old_db ? ( ref $old_db ? ref $old_db : $old_db ) : "undef" );
2500
2501    NEW: 
2502    assert(
2503        __LINE__,
2504        ( not defined $check )
2505          or ref $check
2506          or $check eq "new"
2507          or $check eq "old",
2508        "Error in parameters",
2509        defined $old_new ? ( ref $old_new ? ref $old_new : $old_new ) : "undef",
2510        defined $db_new  ? ( ref $db_new  ? ref $db_new  : $db_new )  : "undef",
2511        defined $old_db  ? ( ref $old_db  ? ref $old_db  : $old_db )  : "undef"
2512    );
2513
2514    Another example shows how this helps displaying lists:
2515
2516    OLD:
2517    %{ $self-&gt;{COMPONENTS} } = (
2518        fname =&gt;
2519        { type =&gt; 'name', adj =&gt; 'yes', font =&gt; 'Helvetica', 'index' =&gt; 0 },
2520        street =&gt;
2521        { type =&gt; 'road', adj =&gt; 'yes', font =&gt; 'Helvetica', 'index' =&gt; 2 },
2522    );
2523
2524    The structure is clearer with the added indentation:
2525
2526    NEW:
2527    %{ $self-&gt;{COMPONENTS} } = (
2528        fname =&gt;
2529          { type =&gt; 'name', adj =&gt; 'yes', font =&gt; 'Helvetica', 'index' =&gt; 0 },
2530        street =&gt;
2531          { type =&gt; 'road', adj =&gt; 'yes', font =&gt; 'Helvetica', 'index' =&gt; 2 },
2532    );
2533
2534    -The structure of nested logical expressions is now displayed better.
2535    Thanks to Wolfgang Weisselberg for helpful discussions.  For example,
2536    note how the status of the final 'or' is displayed in the following:
2537
2538    OLD:
2539    return ( !null($op)
2540          and null( $op-&gt;sibling )
2541          and $op-&gt;ppaddr eq "pp_null"
2542          and class($op) eq "UNOP"
2543          and ( ( $op-&gt;first-&gt;ppaddr =~ /^pp_(and|or)$/
2544            and $op-&gt;first-&gt;first-&gt;sibling-&gt;ppaddr eq "pp_lineseq" )
2545            or ( $op-&gt;first-&gt;ppaddr eq "pp_lineseq"
2546                and not null $op-&gt;first-&gt;first-&gt;sibling
2547                and $op-&gt;first-&gt;first-&gt;sibling-&gt;ppaddr eq "pp_unstack" ) ) );
2548
2549    NEW:
2550    return (
2551        !null($op)
2552          and null( $op-&gt;sibling )
2553          and $op-&gt;ppaddr eq "pp_null"
2554          and class($op) eq "UNOP"
2555          and (
2556            (
2557                $op-&gt;first-&gt;ppaddr =~ /^pp_(and|or)$/
2558                and $op-&gt;first-&gt;first-&gt;sibling-&gt;ppaddr eq "pp_lineseq"
2559            )
2560            or ( $op-&gt;first-&gt;ppaddr eq "pp_lineseq"
2561                and not null $op-&gt;first-&gt;first-&gt;sibling
2562                and $op-&gt;first-&gt;first-&gt;sibling-&gt;ppaddr eq "pp_unstack" )
2563          )
2564    );
2565
2566   -A break will always be put before a list item containing a comma-arrow.
2567   This will improve formatting of mixed lists of this form:
2568
2569        OLD:
2570        $c-&gt;create(
2571            'text', 225, 20, -text =&gt; 'A Simple Plot',
2572            -font =&gt; $font,
2573            -fill =&gt; 'brown'
2574        );
2575
2576        NEW:
2577        $c-&gt;create(
2578            'text', 225, 20,
2579            -text =&gt; 'A Simple Plot',
2580            -font =&gt; $font,
2581            -fill =&gt; 'brown'
2582        );
2583
2584  -For convenience, the command -dac (--delete-all-comments) now also
2585  deletes pod.  Likewise, -tac (--tee-all-comments) now also sends pod
2586  to a '.TEE' file.  Complete control over the treatment of pod and
2587  comments is still possible, as described in the updated help message 
2588  and man page.
2589
2590  -The logic which breaks open 'containers' has been rewritten to be completely
2591  symmetric in the following sense: if a line break is placed after an opening
2592  {, [, or (, then a break will be placed before the corresponding closing
2593  token.  Thus, a container either remains closed or is completely cracked
2594  open.
2595
2596  -Improved indentation of parenthesized lists.  For example, 
2597
2598            OLD:
2599            $GPSCompCourse =
2600              int(
2601              atan2( $GPSTempCompLong - $GPSLongitude,
2602              $GPSLatitude - $GPSTempCompLat ) * 180 / 3.14159265 );
2603
2604            NEW:
2605            $GPSCompCourse = int(
2606                atan2(
2607                    $GPSTempCompLong - $GPSLongitude,
2608                    $GPSLatitude - $GPSTempCompLat
2609                  ) * 180 / 3.14159265
2610            );
2611
2612   Further improvements will be made in future releases.
2613
2614  -Some improvements were made in formatting small lists.
2615
2616  -Correspondence between Input and Output line numbers reported in a 
2617   .LOG file should now be exact.  They were sometimes off due to the size
2618   of intermediate buffers.
2619
2620  -Corrected minor tokenization error in which a ';' in a foreach loop
2621   control was tokenized as a statement termination, which forced a 
2622   line break:
2623
2624        OLD:
2625        foreach ( $i = 0;
2626            $i &lt;= 10;
2627            $i += 2
2628          )
2629        {
2630            print "$i ";
2631        }
2632
2633        NEW:
2634        foreach ( $i = 0 ; $i &lt;= 10 ; $i += 2 ) {
2635            print "$i ";
2636        }
2637
2638  -Corrected a problem with reading config files, in which quote marks were not
2639   stripped.  As a result, something like -wba="&amp;&amp; . || " would have the leading
2640   quote attached to the &amp;&amp; and not work correctly.  A workaround for older
2641   versions is to place a space around all tokens within the quotes, like this:
2642   -wba=" &amp;&amp; . || "
2643
2644  -Removed any existing space between a label and its ':'
2645    OLD    : { }
2646    NEW: { }
2647   This was necessary because the label and its colon are a single token.
2648
2649  -Corrected tokenization error for the following (highly non-recommended) 
2650   construct:
2651    $user = @vars[1] / 100;
2652
2653  -Resolved cause of a difference between perltidy under perl v5.6.1 and
2654  5.005_03; the problem was different behavior of \G regex position
2655  marker(!)
2656 </code></pre>
2657
2658 <h2>2001 10 20</h2>
2659
2660 <pre><code>-Corrected a bug in which a break was not being made after a full-line
2661 comment within a short eval/sort/map/grep block.  A flag was not being
2662 zeroed.  The syntax error check catches this.  Here is a snippet which
2663 illustrates the bug:
2664
2665        eval {
2666            #open Socket to Dispatcher
2667            $sock = &amp;OpenSocket;
2668        };
2669
2670 The formatter mistakenly thought that it had found the following 
2671 one-line block:
2672
2673        eval {#open Socket to Dispatcher$sock = &amp;OpenSocket; };
2674
2675 The patch fixes this. Many thanks to Henry Story for reporting this bug.
2676
2677 -Changes were made to help diagnose and resolve problems in a
2678 .perltidyrc file: 
2679   (1) processing of command parameters has been into two separate
2680   batches so that any errors in a .perltidyrc file can be localized.  
2681   (2) commands --help, --version, and as many of the --dump-xxx
2682   commands are handled immediately, without any command line processing
2683   at all.  
2684   (3) Perltidy will ignore any commands in the .perltidyrc file which
2685   cause immediate exit.  These are:  -h -v -ddf -dln -dop -dsn -dtt
2686   -dwls -dwrs -ss.  Thanks to Wolfgang Weisselberg for helpful
2687   suggestions regarding these updates.
2688
2689 -Syntax check has been reinstated as default for MSWin32 systems.  This
2690 way Windows 2000 users will get syntax check by default, which seems
2691 like a better idea, since the number of Win 95/98 systems will be
2692 decreasing over time.  Documentation revised to warn Windows 95/98
2693 users about the problem with empty '&amp;1'.  Too bad these systems
2694 all report themselves as MSWin32.
2695 </code></pre>
2696
2697 <h2>2001 10 16</h2>
2698
2699 <pre><code>-Fixed tokenization error in which a method call of the form
2700
2701    Module::-&gt;new();
2702
2703  got a space before the '::' like this:
2704
2705    Module ::-&gt;new();
2706
2707  Thanks to David Holden for reporting this.
2708
2709 -Added -html control over pod text, using a new abbreviation 'pd'.  See
2710 updated perl2web man page. The default is to use the color of a comment,
2711 but italicized.  Old .css style sheets will need a new line for
2712 .pd to use this.  The old color was the color of a string, and there
2713 was no control.  
2714
2715 -.css lines are now printed in sorted order.
2716
2717 -Fixed interpolation problem where html files had '$input_file' as title
2718 instead of actual input file name.  Thanks to Simon Perreault for finding
2719 this and sending a patch, and also to Tobias Weber.
2720
2721 -Breaks will now have the ':' placed at the start of a line, 
2722 one per line by default because this shows logical structure
2723 more clearly. This coding has been completely redone. Some 
2724 examples of new ?/: formatting:
2725
2726       OLD:
2727            wantarray ? map( $dir::cwd-&gt;lookup($_)-&gt;path, @_ ) :
2728              $dir::cwd-&gt;lookup( $_[0] )-&gt;path;
2729
2730       NEW:
2731            wantarray 
2732              ? map( $dir::cwd-&gt;lookup($_)-&gt;path, @_ )
2733              : $dir::cwd-&gt;lookup( $_[0] )-&gt;path;
2734
2735       OLD:
2736                $a = ( $b &gt; 0 ) ? {
2737                    a =&gt; 1,
2738                    b =&gt; 2
2739                } : { a =&gt; 6, b =&gt; 8 };
2740
2741       NEW:
2742                $a = ( $b &gt; 0 )
2743                  ? {
2744                    a =&gt; 1,
2745                    b =&gt; 2
2746                  }
2747                  : { a =&gt; 6, b =&gt; 8 };
2748
2749    OLD: (-gnu):
2750    $self-&gt;note($self-&gt;{skip} ? "Hunk #$self-&gt;{hunk} ignored at 1.\n" :
2751                "Hunk #$self-&gt;{hunk} failed--$@");
2752
2753    NEW: (-gnu):
2754    $self-&gt;note($self-&gt;{skip} 
2755                ? "Hunk #$self-&gt;{hunk} ignored at 1.\n"
2756                : "Hunk #$self-&gt;{hunk} failed--$@");
2757
2758    OLD:
2759        $which_search =
2760          $opts{"t"} ? 'title'   :
2761          $opts{"s"} ? 'subject' : $opts{"a"} ? 'author' : 'title';
2762
2763    NEW:
2764        $which_search =
2765          $opts{"t"} ? 'title'
2766          : $opts{"s"} ? 'subject'
2767          : $opts{"a"} ? 'author'
2768          : 'title';
2769
2770 You can use -wba=':' to recover the previous default which placed ':'
2771 at the end of a line.  Thanks to Michael Cartmell for helpful
2772 discussions and examples.  
2773
2774 -Tokenizer updated to do syntax checking for matched ?/: pairs.  Also,
2775 the tokenizer now outputs a unique serial number for every balanced
2776 pair of brace types and ?/: pairs.  This greatly simplifies the
2777 formatter.
2778
2779 -Long lines with repeated 'and', 'or', '&amp;&amp;', '||'  will now have
2780 one such item per line.  For example:
2781
2782    OLD:
2783        if ( $opt_d || $opt_m || $opt_p || $opt_t || $opt_x
2784            || ( -e $archive &amp;&amp; $opt_r ) )
2785        {
2786            ( $pAr, $pNames ) = readAr($archive);
2787        }
2788
2789    NEW:
2790        if ( $opt_d
2791            || $opt_m
2792            || $opt_p
2793            || $opt_t
2794            || $opt_x
2795            || ( -e $archive &amp;&amp; $opt_r ) )
2796        {
2797            ( $pAr, $pNames ) = readAr($archive);
2798        }
2799
2800   OLD:
2801        if ( $vp-&gt;{X0} + 4 &lt;= $x &amp;&amp; $vp-&gt;{X0} + $vp-&gt;{W} - 4 &gt;= $x
2802            &amp;&amp; $vp-&gt;{Y0} + 4 &lt;= $y &amp;&amp; $vp-&gt;{Y0} + $vp-&gt;{H} - 4 &gt;= $y ) 
2803
2804   NEW:
2805        if ( $vp-&gt;{X0} + 4 &lt;= $x
2806            &amp;&amp; $vp-&gt;{X0} + $vp-&gt;{W} - 4 &gt;= $x
2807            &amp;&amp; $vp-&gt;{Y0} + 4 &lt;= $y
2808            &amp;&amp; $vp-&gt;{Y0} + $vp-&gt;{H} - 4 &gt;= $y )
2809
2810 -Long lines with multiple concatenated tokens will have concatenated
2811 terms (see below) placed one per line, except for short items.  For
2812 example:
2813
2814   OLD:
2815        $report .=
2816          "Device type:" . $ib-&gt;family . "  ID:" . $ib-&gt;serial . "  CRC:"
2817          . $ib-&gt;crc . ": " . $ib-&gt;model() . "\n";
2818
2819   NEW:
2820        $report .= "Device type:"
2821          . $ib-&gt;family . "  ID:"
2822          . $ib-&gt;serial . "  CRC:"
2823          . $ib-&gt;model()
2824          . $ib-&gt;crc . ": " . "\n";
2825
2826 NOTE: at present 'short' means 8 characters or less.  There is a
2827 tentative flag to change this (-scl), but it is undocumented and
2828 is likely to be changed or removed later, so only use it for testing.  
2829 In the above example, the tokens "  ID:", "  CRC:", and "\n" are below
2830 this limit.  
2831
2832 -If a line which is short enough to fit on a single line was
2833 nevertheless broken in the input file at a 'good' location (see below), 
2834 perltidy will try to retain a break.  For example, the following line
2835 will be formatted as:
2836
2837    open SUM, "&lt;$file"
2838      or die "Cannot open $file ($!)";
2839
2840 if it was broken in the input file, and like this if not:
2841
2842    open SUM, "&lt;$file" or die "Cannot open $file ($!)";
2843
2844 GOOD: 'good' location means before 'and','or','if','unless','&amp;&amp;','||'
2845
2846 The reason perltidy does not just always break at these points is that if
2847 there are multiple, similar statements, this would preclude alignment.  So
2848 rather than check for this, perltidy just tries to follow the input style,
2849 in the hopes that the author made a good choice. Here is an example where 
2850 we might not want to break before each 'if':
2851
2852    ($Locale, @Locale) = ($English, @English) if (@English &gt; @Locale);
2853    ($Locale, @Locale) = ($German,  @German)  if (@German &gt; @Locale);
2854    ($Locale, @Locale) = ($French,  @French)  if (@French &gt; @Locale);
2855    ($Locale, @Locale) = ($Spanish, @Spanish) if (@Spanish &gt; @Locale);
2856
2857 -Added wildcard file expansion for systems with shells which lack this.
2858 Now 'perltidy *.pl' should work under MSDOS/Windows.  Thanks to Hugh Myers 
2859 for suggesting this.  This uses builtin glob() for now; I may change that.
2860
2861 -Added new flag -sbl which, if specified, overrides the value of -bl
2862 for opening sub braces.  This allows formatting of this type:
2863
2864 perltidy -sbl 
2865
2866 sub foo
2867 {
2868    if (!defined($_[0])) {
2869        print("Hello, World\n");
2870    }
2871    else {
2872        print($_[0], "\n");
2873    }
2874 }
2875 Requested by Don Alexander.
2876
2877 -Fixed minor parsing error which prevented a space after a $$ variable
2878 (pid) in some cases.  Thanks to Michael Cartmell for noting this.
2879 For example, 
2880   old: $$&lt; 700 
2881   new: $$ &lt; 700
2882
2883 -Improved line break choices 'and' and 'or' to display logic better.
2884 For example:
2885
2886    OLD:
2887        exists $self-&gt;{'build_dir'} and push @e,
2888          "Unwrapped into directory $self-&gt;{'build_dir'}";
2889
2890    NEW:
2891        exists $self-&gt;{'build_dir'}
2892          and push @e, "Unwrapped into directory $self-&gt;{'build_dir'}";
2893
2894 -Fixed error of multiple use of abbreviatioin '-dsc'.  -dsc remains 
2895 abbreviation for delete-side-comments; -dsm is new abbreviation for 
2896 delete-semicolons.
2897
2898 -Corrected and updated 'usage' help routine.  Thanks to Slaven Rezic for 
2899 noting an error.
2900
2901 -The default for Windows is, for now, not to do a 'perl -c' syntax
2902 check (but -syn will activate it).  This is because of problems with
2903 command.com.  James Freeman sent me a patch which tries to get around
2904 the problems, and it works in many cases, but testing revealed several
2905 issues that still need to be resolved.  So for now, the default is no
2906 syntax check for Windows.
2907
2908 -I added a -T flag when doing perl -c syntax check.
2909 This is because I test it on a large number of scripts from sources
2910 unknown, and who knows what might be hidden in initialization blocks?
2911 Also, deactivated the syntax check if perltidy is run as root.  As a
2912 benign example, running the previous version of perltidy on the
2913 following file would cause it to disappear:
2914
2915        BEGIN{
2916                print "Bye, bye baby!\n";
2917                unlink $0;
2918        }
2919
2920 The new version will not let that happen.
2921
2922 -I am contemplating (but have not yet implemented) making '-lp' the
2923 default indentation, because it is stable now and may be closer to how
2924 perl is commonly formatted.  This could be in the next release.  The
2925 reason that '-lp' was not the original default is that the coding for
2926 it was complex and not ready for the initial release of perltidy.  If
2927 anyone has any strong feelings about this, I'd like to hear.  The
2928 current default could always be recovered with the '-nlp' flag.
2929 </code></pre>
2930
2931 <h2>2001 09 03</h2>
2932
2933 <pre><code>-html updates:
2934     - sub definition names are now specially colored, red by default.  
2935       The letter 'm' is used to identify them.
2936     - keyword 'sub' now has color of other keywords.
2937     - restored html keyword color to __END__ and __DATA__, which was 
2938       accidentally removed in the previous version.
2939
2940 -A new -se (--standard-error-output) flag has been implemented and
2941 documented which causes all errors to be written to standard output
2942 instead of a .ERR file.
2943
2944 -A new -w (--warning-output) flag has been implemented and documented
2945  which causes perltidy to output certain non-critical messages to the
2946  error output file, .ERR.  These include complaints about pod usage,
2947  for example.  The default is to not include these.
2948
2949  NOTE: This replaces an undocumented -w=0 or --warning-level flag
2950  which was tentatively introduced in the previous version to avoid some
2951  unwanted messages.  The new default is the same as the old -w=0, so
2952  that is no longer needed. 
2953
2954  -Improved syntax checking and corrected tokenization of functions such
2955  as rand, srand, sqrt, ...  These can accept either an operator or a term
2956  to their right.  This has been corrected.
2957
2958 -Corrected tokenization of semicolon: testing of the previous update showed 
2959 that the semicolon in the following statement was being mis-tokenized.  That
2960 did no harm, other than adding an extra blank space, but has been corrected.
2961
2962          for (sort {strcoll($a,$b);} keys %investments) {
2963             ...
2964          }
2965
2966 -New syntax check: after wasting 5 minutes trying to resolve a syntax
2967  error in which I had an extra terminal ';' in a complex for (;;) statement, 
2968  I spent a few more minutes adding a check for this in perltidy so it won't
2969  happen again.
2970
2971 -The behavior of --break-before-subs (-bbs) and --break-before-blocks
2972 (-bbb) has been modified.  Also, a new control parameter,
2973 --long-block-line-count=n (-lbl=n) has been introduced to give more
2974 control on -bbb.  This was previously a hardwired value.  The reason
2975 for the change is to reduce the number of unwanted blank lines that
2976 perltidy introduces, and make it less erratic.  It's annoying to remove
2977 an unwanted blank line and have perltidy put it back.  The goal is to
2978 be able to sprinkle a few blank lines in that dense script you
2979 inherited from Bubba.  I did a lot of experimenting with different
2980 schemes for introducing blank lines before and after code blocks, and
2981 decided that there is no really good way to do it.  But I think the new
2982 scheme is an improvement.  You can always deactivate this with -nbbb.
2983 I've been meaning to work on this; thanks to Erik Thaysen for bringing
2984 it to my attention.
2985
2986 -The .LOG file is seldom needed, and I get tired of deleting them, so
2987  they will now only be automatically saved if perltidy thinks that it
2988  made an error, which is almost never.  You can still force the logfile
2989  to be saved with -log or -g.
2990
2991 -Improved method for computing number of columns in a table.  The old
2992 method always tried for an even number.  The new method allows odd
2993 numbers when it is obvious that a list is not a hash initialization
2994 list.
2995
2996   old: my (
2997             $name,       $xsargs, $parobjs, $optypes,
2998             $hasp2child, $pmcode, $hdrcode, $inplacecode,
2999             $globalnew,  $callcopy
3000          )
3001          = @_;
3002
3003   new: my (
3004             $name,   $xsargs,  $parobjs,     $optypes,   $hasp2child,
3005             $pmcode, $hdrcode, $inplacecode, $globalnew, $callcopy
3006          )
3007          = @_;
3008
3009 -I fiddled with the list threshold adjustment, and some small lists
3010 look better now.  Here is the change for one of the lists in test file
3011 'sparse.t':
3012 old:
3013   %units =
3014     ("in", "in", "pt", "pt", "pc", "pi", "mm", "mm", "cm", "cm", "\\hsize", "%",
3015       "\\vsize", "%", "\\textwidth", "%", "\\textheight", "%");
3016
3017 new:
3018   %units = (
3019              "in",      "in", "pt",          "pt", "pc",           "pi",
3020              "mm",      "mm", "cm",          "cm", "\\hsize",      "%",
3021              "\\vsize", "%",  "\\textwidth", "%",  "\\textheight", "%"
3022              );
3023
3024 -Improved -lp formatting at '=' sign.  A break was always being added after
3025 the '=' sign in a statement such as this, (to be sure there was enough room
3026 for the parameters):
3027
3028 old: my $fee =
3029        CalcReserveFee(
3030                        $env,          $borrnum,
3031                        $biblionumber, $constraint,
3032                        $bibitems
3033                        );
3034
3035 The updated version doesn't do this unless the space is really needed:
3036
3037 new: my $fee = CalcReserveFee(
3038                               $env,          $borrnum,
3039                               $biblionumber, $constraint,
3040                               $bibitems
3041                               );
3042
3043 -I updated the tokenizer to allow $#+ and $#-, which seem to be new to
3044 Perl 5.6.  Some experimenting with a recent version of Perl indicated
3045 that it allows these non-alphanumeric '$#' array maximum index
3046 varaibles: $#: $#- $#+ so I updated the parser accordingly.  Only $#:
3047 seems to be valid in older versions of Perl.
3048
3049 -Fixed a rare formatting problem with -lp (and -gnu) which caused
3050 excessive indentation.
3051
3052 -Many additional syntax checks have been added.
3053
3054 -Revised method for testing here-doc target strings; the following
3055 was causing trouble with a regex test because of the '*' characters:
3056  print &lt;&lt;"*EOF*";
3057  bla bla
3058  *EOF*
3059 Perl seems to allow almost anything to be a here doc target, so an
3060 exact string comparison is now used.
3061
3062 -Made update to allow underscores in binary numbers, like '0b1100_0000'.
3063
3064 -Corrected problem with scanning certain module names; a blank space was 
3065 being inserted after 'warnings' in the following:
3066    use warnings::register;
3067 The problem was that warnings (and a couple of other key modules) were 
3068 being tokenized as keywords.  They should have just been identifiers.
3069
3070 -Corrected tokenization of indirect objects after sort, system, and exec,
3071 after testing produced an incorrect error message for the following
3072 line of code:
3073    print sort $sortsubref @list;
3074
3075 -Corrected minor problem where a line after a format had unwanted
3076 extra continuation indentation.  
3077
3078 -Delete-block-comments (and -dac) now retain any leading hash-bang line
3079
3080 -Update for -lp (and -gnu) to not align the leading '=' of a list
3081 with a previous '=', since this interferes with alignment of parameters.
3082
3083  old:  my $hireDay = new Date;
3084        my $self    = {
3085                     firstName =&gt; undef,
3086                     lastName  =&gt; undef,
3087                     hireDay   =&gt; $hireDay
3088                     };
3089
3090  new:  my $hireDay = new Date;
3091        my $self = {
3092                     firstName =&gt; undef,
3093                     lastName  =&gt; undef,
3094                     hireDay   =&gt; $hireDay
3095                     };
3096
3097 -Modifications made to display tables more compactly when possible,
3098  without adding lines. For example,
3099  old:
3100                '1', "I", '2', "II", '3', "III", '4', "IV",
3101                '5', "V", '6', "VI", '7', "VII", '8', "VIII",
3102                '9', "IX"
3103  new:
3104                '1', "I",   '2', "II",   '3', "III",
3105                '4', "IV",  '5', "V",    '6', "VI",
3106                '7', "VII", '8', "VIII", '9', "IX"
3107
3108 -Corrected minor bug in which -pt=2 did not keep the right paren tight
3109 around a '++' or '--' token, like this:
3110
3111            for ($i = 0 ; $i &lt; length $key ; $i++ )
3112
3113 The formatting for this should be, and now is: 
3114
3115            for ($i = 0 ; $i &lt; length $key ; $i++)
3116
3117 Thanks to Erik Thaysen for noting this.
3118
3119 -Discovered a new bug involving here-docs during testing!  See BUGS.html.  
3120
3121 -Finally fixed parsing of subroutine attributes (A Perl 5.6 feature).
3122 However, the attributes and prototypes must still be on the same line
3123 as the sub name.
3124 </code></pre>
3125
3126 <h2>2001 07 31</h2>
3127
3128 <pre><code>-Corrected minor, uncommon bug found during routine testing, in which a
3129 blank got inserted between a function name and its opening paren after
3130 a file test operator, but only in the case that the function had not
3131 been previously seen.  Perl uses the existence (or lack thereof) of 
3132 the blank to guess if it is a function call.  That is,
3133    if (-l pid_filename()) {
3134 became
3135    if (-l pid_filename ()) {
3136 which is a syntax error if pid_filename has not been seen by perl.
3137
3138 -If the AutoLoader module is used, perltidy will continue formatting
3139 code after seeing an __END__ line.  Use -nlal to deactivate this feature.  
3140 Likewise, if the SelfLoader module is used, perltidy will continue 
3141 formatting code after seeing a __DATA__ line.  Use -nlsl to
3142 deactivate this feature.  Thanks to Slaven Rezic for this suggestion.
3143
3144 -pod text after __END__ and __DATA__ is now identified by perltidy
3145 so that -dp works correctly.  Thanks to Slaven Rezic for this suggestion.
3146
3147 -The first $VERSION line which might be eval'd by MakeMaker
3148 is now passed through unchanged.  Use -npvl to deactivate this feature.
3149 Thanks to Manfred Winter for this suggestion.
3150
3151 -Improved indentation of nested parenthesized expressions.  Tests have
3152 given favorable results.  Thanks to Wolfgang Weisselberg for helpful
3153 examples.
3154 </code></pre>
3155
3156 <h2>2001 07 23</h2>
3157
3158 <pre><code>-Fixed a very rare problem in which an unwanted semicolon was inserted
3159 due to misidentification of anonymous hash reference curly as a code
3160 block curly.  (No instances of this have been reported; I discovered it
3161 during testing).  A workaround for older versions of perltidy is to use
3162 -nasc.
3163
3164 -Added -icb (-indent-closing-brace) parameter to indent a brace which
3165 terminates a code block to the same level as the previous line.
3166 Suggested by Andrew Cutler.  For example, 
3167
3168        if ($task) {
3169            yyy();
3170            }    # -icb
3171        else {
3172            zzz();
3173            }
3174
3175 -Rewrote error message triggered by an unknown bareword in a print or
3176 printf filehandle position, and added flag -w=0 to prevent issuing this
3177 error message.  Suggested by Byron Jones.
3178
3179 -Added modification to align a one-line 'if' block with similar
3180 following 'elsif' one-line blocks, like this:
3181      if    ( $something eq "simple" )  { &amp;handle_simple }
3182      elsif ( $something eq "hard" )    { &amp;handle_hard }
3183 (Suggested by  Wolfgang Weisselberg).
3184 </code></pre>
3185
3186 <h2>2001 07 02</h2>
3187
3188 <pre><code>-Eliminated all constants with leading underscores because perl 5.005_03
3189 does not support that.  For example, _SPACES changed to XX_SPACES.
3190 Thanks to kromJx for this update.
3191 </code></pre>
3192
3193 <h2>2001 07 01</h2>
3194
3195 <pre><code>-the directory of test files has been moved to a separate distribution
3196 file because it is getting large but is of little interest to most users.
3197 For the current distribution:
3198   perltidy-20010701.tgz        contains the source and docs for perltidy
3199   perltidy-20010701-test.tgz   contains the test files
3200
3201 -fixed bug where temporary file perltidy.TMPI was not being deleted 
3202 when input was from stdin.
3203
3204 -adjusted line break logic to not break after closing brace of an
3205 eval block (suggested by Boris Zentner).
3206
3207 -added flag -gnu (--gnu-style) to give an approximation to the GNU
3208 style as sometimes applied to perl.  The programming style in GNU
3209 'automake' was used as a guide in setting the parameters; these
3210 parameters will probably be adjusted over time.
3211
3212 -an empty code block now has one space for emphasis:
3213   if ( $cmd eq "bg_untested" ) {}    # old
3214   if ( $cmd eq "bg_untested" ) { }   # new
3215 If this bothers anyone, we could create a parameter.
3216
3217 -the -bt (--brace-tightness) parameter has been split into two
3218 parameters to give more control. -bt now applies only to non-BLOCK
3219 braces, while a new parameter -bbt (block-brace-tightness) applies to
3220 curly braces which contain code BLOCKS. The default value is -bbt=0.
3221
3222 -added flag -icp (--indent-closing-paren) which leaves a statement
3223 termination of the form );, };, or ]; indented with the same
3224 indentation as the previous line.  For example,
3225
3226    @month_of_year = (          # default, or -nicp
3227        'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct',
3228        'Nov', 'Dec'
3229    );
3230
3231    @month_of_year = (          # -icp
3232        'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct',
3233        'Nov', 'Dec'
3234        );
3235
3236 -Vertical alignment updated to synchronize with tokens &amp;&amp;, ||,
3237 and, or, if, unless.  Allowable space before forcing
3238 resynchronization has been increased.  (Suggested by  Wolfgang
3239 Weisselberg).
3240
3241 -html corrected to use -nohtml-bold-xxxxxxx or -nhbx to negate bold,
3242 and likewise -nohtml-italic-xxxxxxx or -nhbi to negate italic.  There
3243 was no way to negate these previously.  html documentation updated and
3244 corrected.  (Suggested by  Wolfgang Weisselberg).
3245
3246 -Some modifications have been made which improve the -lp formatting in
3247 a few cases.
3248
3249 -Perltidy now retains or creates a blank line after an =cut to keep
3250 podchecker happy (Suggested by Manfred H. Winter).  This appears to be
3251 a glitch in podchecker, but it was annoying.
3252 </code></pre>
3253
3254 <h2>2001 06 17</h2>
3255
3256 <pre><code>-Added -bli flag to give continuation indentation to braces, like this
3257
3258        if ($bli_flag)
3259          {
3260            extra_indentation();
3261          }
3262
3263 -Corrected an error with the tab (-t) option which caused the last line
3264 of a multi-line quote to receive a leading tab.  This error was in
3265 version 2001 06 08  but not 2001 04 06.  If you formatted a script
3266 with -t with this version, please check it by running once with the
3267 -chk flag and perltidy will scan for this possible error.
3268
3269 -Corrected an invalid pattern (\R should have been just R), changed
3270 $^W =1 to BEGIN {$^W=1} to use warnings in compile phase, and corrected
3271 several unnecessary 'my' declarations. Many thanks to Wolfgang Weisselberg,
3272 2001-06-12, for catching these errors.
3273
3274 -A '-bar' flag has been added to require braces to always be on the
3275 right, even for multi-line if and foreach statements.  For example,
3276 the default formatting of a long if statement would be:
3277
3278        if ($bigwasteofspace1 &amp;&amp; $bigwasteofspace2
3279          || $bigwasteofspace3 &amp;&amp; $bigwasteofspace4)
3280        {
3281            bigwastoftime();
3282        }
3283
3284 With -bar, the formatting is:
3285
3286        if ($bigwasteofspace1 &amp;&amp; $bigwasteofspace2
3287          || $bigwasteofspace3 &amp;&amp; $bigwasteofspace4) {
3288            bigwastoftime();
3289        }
3290 Suggested by Eli Fidler 2001-06-11.
3291
3292 -Uploaded perltidy to sourceforge cvs 2001-06-10.
3293
3294 -An '-lp' flag (--line-up-parentheses) has been added which causes lists
3295 to be indented with extra indentation in the manner sometimes
3296 associated with emacs or the GNU suggestions.  Thanks to Ian Stuart for
3297 this suggestion and for extensive help in testing it. 
3298
3299 -Subroutine call parameter lists are now formatted as other lists.
3300 This should improve formatting of tables being passed via subroutine
3301 calls.  This will also cause full indentation ('-i=n, default n= 4) of
3302 continued parameter list lines rather than just the number of spaces
3303 given with -ci=n, default n=2.
3304
3305 -Added support for hanging side comments.  Perltidy identifies a hanging
3306 side comment as a comment immediately following a line with a side
3307 comment or another hanging side comment.  This should work in most
3308 cases.  It can be deactivated with --no-hanging-side-comments (-nhsc).
3309 The manual has been updated to discuss this.  Suggested by Brad
3310 Eisenberg some time ago, and finally implemented.
3311 </code></pre>
3312
3313 <h2>2001 06 08</h2>
3314
3315 <pre><code>-fixed problem with parsing command parameters containing quoted
3316 strings in .perltidyrc files. (Reported by Roger Espel Llima 2001-06-07).
3317
3318 -added two command line flags, --want-break-after and 
3319 --want-break-before, which allow changing whether perltidy
3320 breaks lines before or after any operators.  Please see the revised 
3321 man pages for details.
3322
3323 -added system-wide configuration file capability.
3324 If perltidy does not find a .perltidyrc command line file in
3325 the current directory, nor in the home directory, it now looks
3326 for '/usr/local/etc/perltidyrc' and then for '/etc/perltidyrc'.
3327 (Suggested by Roger Espel Llima 2001-05-31).
3328
3329 -fixed problem in which spaces were trimmed from lines of a multi-line
3330 quote. (Reported by Roger Espel Llima 2001-05-30).  This is an 
3331 uncommon situation, but serious, because it could conceivably change
3332 the proper function of a script.
3333
3334 -fixed problem in which a semicolon was incorrectly added within 
3335 an anonymous hash.  (Reported by A.C. Yardley, 2001-5-23).
3336 (You would know if this happened, because perl would give a syntax
3337 error for the resulting script).
3338
3339 -fixed problem in which an incorrect error message was produced
3340  after a version number on a 'use' line, like this ( Reported 
3341  by Andres Kroonmaa, 2001-5-14):
3342
3343              use CGI 2.42 qw(fatalsToBrowser);
3344
3345  Other than the extraneous error message, this bug was harmless.
3346 </code></pre>
3347
3348 <h2>2001 04 06</h2>
3349
3350 <pre><code>-fixed serious bug in which the last line of some multi-line quotes or
3351  patterns was given continuation indentation spaces.  This may make
3352  a pattern incorrect unless it uses the /x modifier.  To find
3353  instances of this error in scripts which have been formatted with
3354  earlier versions of perltidy, run with the -chk flag, which has
3355  been added for this purpose (SLH, 2001-04-05).
3356
3357  ** So, please check previously formatted scripts by running with -chk
3358  at least once **
3359
3360 -continuation indentation has been reprogrammed to be hierarchical, 
3361  which improves deeply nested structures.
3362
3363 -fixed problem with undefined value in list formatting (reported by Michael
3364  Langner 2001-04-05)
3365
3366 -Switched to graphical display of nesting in .LOG files.  If an
3367  old format string was "(1 [0 {2", the new string is "{{(".  This
3368  is easier to read and also shows the order of nesting.
3369
3370 -added outdenting of cuddled paren structures, like  ")-&gt;pack(".
3371
3372 -added line break and outdenting of ')-&gt;' so that instead of
3373
3374        $mw-&gt;Label(
3375          -text   =&gt; "perltidy",
3376          -relief =&gt; 'ridge')-&gt;pack;
3377
3378  the current default is:
3379
3380        $mw-&gt;Label(
3381          -text   =&gt; "perltidy",
3382          -relief =&gt; 'ridge'
3383        )-&gt;pack;
3384
3385  (requested by Michael Langner 2001-03-31; in the future this could 
3386  be controlled by a command-line parameter).
3387
3388 -revised list indentation logic, so that lists following an assignment
3389  operator get one full indentation level, rather than just continuation 
3390  indentation.  Also corrected some minor glitches in the continuation 
3391  indentation logic. 
3392
3393 -Fixed problem with unwanted continuation indentation after a blank line 
3394 (reported by Erik Thaysen 2001-03-28):
3395
3396 -minor update to avoid stranding a single '(' on one line
3397 </code></pre>
3398
3399 <h2>2001 03 28:</h2>
3400
3401 <pre><code>-corrected serious error tokenizing filehandles, in which a sub call 
3402 after a print or printf, like this:
3403    print usage() and exit;
3404 became this:
3405    print usage () and exit;
3406 Unfortunately, this converts 'usage' to a filehandle.  To fix this, rerun
3407 perltidy; it will look for this situation and issue a warning. 
3408
3409 -fixed another cuddled-else formatting bug (Reported by Craig Bourne)
3410
3411 -added several diagnostic --dump routines
3412
3413 -added token-level whitespace controls (suggested by Hans Ecke)
3414 </code></pre>
3415
3416 <h2>2001 03 23:</h2>
3417
3418 <pre><code>-added support for special variables of the form ${^WANT_BITS}
3419
3420 -space added between scalar and left paren in 'for' and 'foreach' loops,
3421  (suggestion by Michael Cartmell):
3422
3423    for $i( 1 .. 20 )   # old
3424    for $i ( 1 .. 20 )   # new
3425
3426 -html now outputs cascading style sheets (thanks to suggestion from
3427  Hans Ecke)
3428
3429 -flags -o and -st now work with -html
3430
3431 -added missing -html documentation for comments (noted by Alex Izvorski)
3432
3433 -support for VMS added (thanks to Michael Cartmell for code patches and 
3434   testing)
3435
3436 -v-strings implemented (noted by Hans Ecke and Michael Cartmell; extensive
3437   testing by Michael Cartmell)
3438
3439 -fixed problem where operand may be empty at line 3970 
3440  (\b should be just b in lines 3970, 3973) (Thanks to Erik Thaysen, 
3441  Keith Marshall for bug reports)
3442
3443 -fixed -ce bug (cuddled else), where lines like '} else {' were indented
3444  (Thanks to Shawn Stepper and Rick Measham for reporting this)
3445 </code></pre>
3446
3447 <h2>2001 03 04:</h2>
3448
3449 <pre><code>-fixed undefined value in line 153 (only worked with -I set)
3450 (Thanks to Mike Stok, Phantom of the Opcodes, Ian Ehrenwald, and others)
3451
3452 -fixed undefined value in line 1069 (filehandle problem with perl versions &lt;
3453 5.6) (Thanks to Yuri Leikind, Mike Stok, Michael Holve, Jeff Kolber)
3454 </code></pre>
3455
3456 <h2>2001 03 03:</h2>
3457
3458 <pre><code>-Initial announcement at freshmeat.net; started Change Log
3459 (Unfortunately this version was DOA, but it was fixed the next day)
3460 </code></pre>