1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867
|
<HTML>
<HEAD>
<TITLE>Perltidy Change Log</TITLE>
<LINK REV="made" HREF="mailto:perl@packages.debian.org">
</HEAD>
<BODY>
<A NAME="__index__"></A>
<!-- INDEX BEGIN -->
<UL>
<LI><A HREF="#perltidy change log">Perltidy Change Log</A></LI>
<UL>
<LI><A HREF="#2001 10 20">2001 10 20</A></LI>
<LI><A HREF="#2001 10 16">2001 10 16</A></LI>
<LI><A HREF="#2001 09 03">2001 09 03</A></LI>
<LI><A HREF="#2001 07 31">2001 07 31</A></LI>
<LI><A HREF="#2001 07 23">2001 07 23 </A></LI>
<LI><A HREF="#2001 07 02">2001 07 02</A></LI>
<LI><A HREF="#2001 07 01">2001 07 01</A></LI>
<LI><A HREF="#2001 06 17">2001 06 17</A></LI>
<LI><A HREF="#2001 06 08">2001 06 08</A></LI>
<LI><A HREF="#2001 04 06">2001 04 06 </A></LI>
<LI><A HREF="#2001 03 28:">2001 03 28:</A></LI>
<LI><A HREF="#2001 03 23:">2001 03 23:</A></LI>
<LI><A HREF="#2001 03 04:">2001 03 04:</A></LI>
<LI><A HREF="#2001 03 03:">2001 03 03:</A></LI>
</UL>
</UL>
<!-- INDEX END -->
<HR>
<P>
<H1><A NAME="perltidy change log">Perltidy Change Log</A></H1>
<PRE>
You can help Perltidy evolve into a better program. If you
have hit a bug, unusual behavior, annoyance, or have a suggested
improvement, please send a note to perltidy at users.sourceforge.net.</PRE>
<P>
<H2><A NAME="2001 10 20">2001 10 20</A></H2>
<PRE>
-Corrected a bug in which a break was not being made after a full-line
comment within a short eval/sort/map/grep block. A flag was not being
zeroed. The syntax error check catches this. Here is a snippet which
illustrates the bug:</PRE>
<PRE>
eval {
#open Socket to Dispatcher
$sock = &OpenSocket;
};</PRE>
<PRE>
The formatter mistakenly thought that it had found the following
one-line block:
</PRE>
<PRE>
eval {#open Socket to Dispatcher$sock = &OpenSocket; };</PRE>
<PRE>
The patch fixes this. Many thanks to Henry Story for reporting this bug.</PRE>
<PRE>
-Changes were made to help diagnose and resolve problems in a
.perltidyrc file:
(1) processing of command parameters has been into two separate
batches so that any errors in a .perltidyrc file can be localized.
(2) commands --help, --version, and as many of the --dump-xxx
commands are handled immediately, without any command line processing
at all.
(3) Perltidy will ignore any commands in the .perltidyrc file which
cause immediate exit. These are: -h -v -ddf -dln -dop -dsn -dtt
-dwls -dwrs -ss. Thanks to Wolfgang Weisselberg for helpful
suggestions regarding these updates.</PRE>
<PRE>
-Syntax check has been reinstated as default for MSWin32 systems. This
way Windows 2000 users will get syntax check by default, which seems
like a better idea, since the number of Win 95/98 systems will be
decreasing over time. Documentation revised to warn Windows 95/98
users about the problem with empty '&1'. Too bad these systems
all report themselves as MSWin32.</PRE>
<P>
<H2><A NAME="2001 10 16">2001 10 16</A></H2>
<PRE>
-Fixed tokenization error in which a method call of the form</PRE>
<PRE>
Module::->new();
</PRE>
<PRE>
got a space before the '::' like this:</PRE>
<PRE>
Module ::->new();</PRE>
<PRE>
Thanks to David Holden for reporting this.
</PRE>
<PRE>
-Added -html control over pod text, using a new abbreviation 'pd'. See
updated perl2web man page. The default is to use the color of a comment,
but italicized. Old .css style sheets will need a new line for
.pd to use this. The old color was the color of a string, and there
was no control.</PRE>
<PRE>
-.css lines are now printed in sorted order.</PRE>
<PRE>
-Fixed interpolation problem where html files had '$input_file' as title
instead of actual input file name. Thanks to Simon Perreault for finding
this and sending a patch, and also to Tobias Weber.</PRE>
<PRE>
-Breaks will now have the ':' placed at the start of a line,
one per line by default because this shows logical structure
more clearly. This coding has been completely redone. Some
examples of new ?/: formatting:</PRE>
<PRE>
OLD:
wantarray ? map( $dir::cwd->lookup($_)->path, @_ ) :
$dir::cwd->lookup( $_[0] )->path;</PRE>
<PRE>
NEW:
wantarray
? map( $dir::cwd->lookup($_)->path, @_ )
: $dir::cwd->lookup( $_[0] )->path;</PRE>
<PRE>
OLD:
$a = ( $b > 0 ) ? {
a => 1,
b => 2
} : { a => 6, b => 8 };</PRE>
<PRE>
NEW:
$a = ( $b > 0 )
? {
a => 1,
b => 2
}
: { a => 6, b => 8 };</PRE>
<PRE>
OLD: (-gnu):
$self->note($self->{skip} ? "Hunk #$self->{hunk} ignored at 1.\n" :
"Hunk #$self->{hunk} failed--$@");</PRE>
<PRE>
NEW: (-gnu):
$self->note($self->{skip}
? "Hunk #$self->{hunk} ignored at 1.\n"
: "Hunk #$self->{hunk} failed--$@");</PRE>
<PRE>
OLD:
$which_search =
$opts{"t"} ? 'title' :
$opts{"s"} ? 'subject' : $opts{"a"} ? 'author' : 'title';</PRE>
<PRE>
NEW:
$which_search =
$opts{"t"} ? 'title'
: $opts{"s"} ? 'subject'
: $opts{"a"} ? 'author'
: 'title';
</PRE>
<PRE>
You can use -wba=':' to recover the previous default which placed ':'
at the end of a line. Thanks to Michael Cartmell for helpful
discussions and examples.</PRE>
<PRE>
-Tokenizer updated to do syntax checking for matched ?/: pairs. Also,
the tokenizer now outputs a unique serial number for every balanced
pair of brace types and ?/: pairs. This greatly simplifies the
formatter.</PRE>
<PRE>
-Long lines with repeated 'and', 'or', '&&', '||' will now have
one such item per line. For example:</PRE>
<PRE>
OLD:
if ( $opt_d || $opt_m || $opt_p || $opt_t || $opt_x
|| ( -e $archive && $opt_r ) )
{
( $pAr, $pNames ) = readAr($archive);
}</PRE>
<PRE>
NEW:
if ( $opt_d
|| $opt_m
|| $opt_p
|| $opt_t
|| $opt_x
|| ( -e $archive && $opt_r ) )
{
( $pAr, $pNames ) = readAr($archive);
}</PRE>
<PRE>
OLD:
if ( $vp->{X0} + 4 <= $x && $vp->{X0} + $vp->{W} - 4 >= $x
&& $vp->{Y0} + 4 <= $y && $vp->{Y0} + $vp->{H} - 4 >= $y )</PRE>
<PRE>
NEW:
if ( $vp->{X0} + 4 <= $x
&& $vp->{X0} + $vp->{W} - 4 >= $x
&& $vp->{Y0} + 4 <= $y
&& $vp->{Y0} + $vp->{H} - 4 >= $y )</PRE>
<PRE>
-Long lines with multiple concatenated tokens will have concatenated
terms (see below) placed one per line, except for short items. For
example:</PRE>
<PRE>
OLD:
$report .=
"Device type:" . $ib->family . " ID:" . $ib->serial . " CRC:"
. $ib->crc . ": " . $ib->model() . "\n";</PRE>
<PRE>
NEW:
$report .= "Device type:"
. $ib->family . " ID:"
. $ib->serial . " CRC:"
. $ib->model()
. $ib->crc . ": " . "\n";</PRE>
<PRE>
NOTE: at present 'short' means 8 characters or less. There is a
tentative flag to change this (-scl), but it is undocumented and
is likely to be changed or removed later, so only use it for testing.
In the above example, the tokens " ID:", " CRC:", and "\n" are below
this limit.</PRE>
<PRE>
-If a line which is short enough to fit on a single line was
nevertheless broken in the input file at a 'good' location (see below),
perltidy will try to retain a break. For example, the following line
will be formatted as:
</PRE>
<PRE>
open SUM, "<$file"
or die "Cannot open $file ($!)";</PRE>
<PRE>
if it was broken in the input file, and like this if not:</PRE>
<PRE>
open SUM, "<$file" or die "Cannot open $file ($!)";</PRE>
<PRE>
GOOD: 'good' location means before 'and','or','if','unless','&&','||'</PRE>
<PRE>
The reason perltidy does not just always break at these points is that if
there are multiple, similar statements, this would preclude alignment. So
rather than check for this, perltidy just tries to follow the input style,
in the hopes that the author made a good choice. Here is an example where
we might not want to break before each 'if':</PRE>
<PRE>
($Locale, @Locale) = ($English, @English) if (@English > @Locale);
($Locale, @Locale) = ($German, @German) if (@German > @Locale);
($Locale, @Locale) = ($French, @French) if (@French > @Locale);
($Locale, @Locale) = ($Spanish, @Spanish) if (@Spanish > @Locale);</PRE>
<PRE>
-Added wildcard file expansion for systems with shells which lack this.
Now 'perltidy *.pl' should work under MSDOS/Windows. Thanks to Hugh Myers
for suggesting this. This uses builtin glob() for now; I may change that.</PRE>
<PRE>
-Added new flag -sbl which, if specified, overrides the value of -bl
for opening sub braces. This allows formatting of this type:</PRE>
<PRE>
perltidy -sbl</PRE>
<PRE>
sub foo
{
if (!defined($_[0])) {
print("Hello, World\n");
}
else {
print($_[0], "\n");
}
}
Requested by Don Alexander.</PRE>
<PRE>
-Fixed minor parsing error which prevented a space after a $$ variable
(pid) in some cases. Thanks to Michael Cartmell for noting this.
For example,
old: $$< 700
new: $$ < 700</PRE>
<PRE>
-Improved line break choices 'and' and 'or' to display logic better.
For example:</PRE>
<PRE>
OLD:
exists $self->{'build_dir'} and push @e,
"Unwrapped into directory $self->{'build_dir'}";</PRE>
<PRE>
NEW:
exists $self->{'build_dir'}
and push @e, "Unwrapped into directory $self->{'build_dir'}";</PRE>
<PRE>
-Fixed error of multiple use of abbreviatioin '-dsc'. -dsc remains
abbreviation for delete-side-comments; -dsm is new abbreviation for
delete-semicolons.</PRE>
<PRE>
-Corrected and updated 'usage' help routine. Thanks to Slaven Rezic for
noting an error.</PRE>
<PRE>
-The default for Windows is, for now, not to do a 'perl -c' syntax
check (but -syn will activate it). This is because of problems with
command.com. James Freeman sent me a patch which tries to get around
the problems, and it works in many cases, but testing revealed several
issues that still need to be resolved. So for now, the default is no
syntax check for Windows.</PRE>
<PRE>
-I added a -T flag when doing perl -c syntax check.
This is because I test it on a large number of scripts from sources
unknown, and who knows what might be hidden in initialization blocks?
Also, deactivated the syntax check if perltidy is run as root. As a
benign example, running the previous version of perltidy on the
following file would cause it to disappear:</PRE>
<PRE>
BEGIN{
print "Bye, bye baby!\n";
unlink $0;
}
</PRE>
<PRE>
The new version will not let that happen.</PRE>
<PRE>
-I am contemplating (but have not yet implemented) making '-lp' the
default indentation, because it is stable now and may be closer to how
perl is commonly formatted. This could be in the next release. The
reason that '-lp' was not the original default is that the coding for
it was complex and not ready for the initial release of perltidy. If
anyone has any strong feelings about this, I'd like to hear. The
current default could always be recovered with the '-nlp' flag.</PRE>
<P>
<H2><A NAME="2001 09 03">2001 09 03</A></H2>
<PRE>
-html updates:
- sub definition names are now specially colored, red by default.
The letter 'm' is used to identify them.
- keyword 'sub' now has color of other keywords.
- restored html keyword color to __END__ and __DATA__, which was
accidentally removed in the previous version.</PRE>
<PRE>
-A new -se (--standard-error-output) flag has been implemented and
documented which causes all errors to be written to standard output
instead of a .ERR file.</PRE>
<PRE>
-A new -w (--warning-output) flag has been implemented and documented
which causes perltidy to output certain non-critical messages to the
error output file, .ERR. These include complaints about pod usage,
for example. The default is to not include these.</PRE>
<PRE>
NOTE: This replaces an undocumented -w=0 or --warning-level flag
which was tentatively introduced in the previous version to avoid some
unwanted messages. The new default is the same as the old -w=0, so
that is no longer needed.</PRE>
<PRE>
-Improved syntax checking and corrected tokenization of functions such
as rand, srand, sqrt, ... These can accept either an operator or a term
to their right. This has been corrected.
</PRE>
<PRE>
-Corrected tokenization of semicolon: testing of the previous update showed
that the semicolon in the following statement was being mis-tokenized. That
did no harm, other than adding an extra blank space, but has been corrected.</PRE>
<PRE>
for (sort {strcoll($a,$b);} keys %investments) {
...
}</PRE>
<PRE>
-New syntax check: after wasting 5 minutes trying to resolve a syntax
error in which I had an extra terminal ';' in a complex for (;;) statement,
I spent a few more minutes adding a check for this in perltidy so it won't
happen again.</PRE>
<PRE>
-The behavior of --break-before-subs (-bbs) and --break-before-blocks
(-bbb) has been modified. Also, a new control parameter,
--long-block-line-count=n (-lbl=n) has been introduced to give more
control on -bbb. This was previously a hardwired value. The reason
for the change is to reduce the number of unwanted blank lines that
perltidy introduces, and make it less erratic. It's annoying to remove
an unwanted blank line and have perltidy put it back. The goal is to
be able to sprinkle a few blank lines in that dense script you
inherited from Bubba. I did a lot of experimenting with different
schemes for introducing blank lines before and after code blocks, and
decided that there is no really good way to do it. But I think the new
scheme is an improvement. You can always deactivate this with -nbbb.
I've been meaning to work on this; thanks to Erik Thaysen for bringing
it to my attention.</PRE>
<PRE>
-The .LOG file is seldom needed, and I get tired of deleting them, so
they will now only be automatically saved if perltidy thinks that it
made an error, which is almost never. You can still force the logfile
to be saved with -log or -g.</PRE>
<PRE>
-Improved method for computing number of columns in a table. The old
method always tried for an even number. The new method allows odd
numbers when it is obvious that a list is not a hash initialization
list.</PRE>
<PRE>
old: my (
$name, $xsargs, $parobjs, $optypes,
$hasp2child, $pmcode, $hdrcode, $inplacecode,
$globalnew, $callcopy
)
= @_;</PRE>
<PRE>
new: my (
$name, $xsargs, $parobjs, $optypes, $hasp2child,
$pmcode, $hdrcode, $inplacecode, $globalnew, $callcopy
)
= @_;</PRE>
<PRE>
-I fiddled with the list threshold adjustment, and some small lists
look better now. Here is the change for one of the lists in test file
'sparse.t':
old:
%units =
("in", "in", "pt", "pt", "pc", "pi", "mm", "mm", "cm", "cm", "\\hsize", "%",
"\\vsize", "%", "\\textwidth", "%", "\\textheight", "%");</PRE>
<PRE>
new:
%units = (
"in", "in", "pt", "pt", "pc", "pi",
"mm", "mm", "cm", "cm", "\\hsize", "%",
"\\vsize", "%", "\\textwidth", "%", "\\textheight", "%"
);</PRE>
<PRE>
-Improved -lp formatting at '=' sign. A break was always being added after
the '=' sign in a statement such as this, (to be sure there was enough room
for the parameters):</PRE>
<PRE>
old: my $fee =
CalcReserveFee(
$env, $borrnum,
$biblionumber, $constraint,
$bibitems
);
</PRE>
<PRE>
The updated version doesn't do this unless the space is really needed:</PRE>
<PRE>
new: my $fee = CalcReserveFee(
$env, $borrnum,
$biblionumber, $constraint,
$bibitems
);</PRE>
<PRE>
-I updated the tokenizer to allow $#+ and $#-, which seem to be new to
Perl 5.6. Some experimenting with a recent version of Perl indicated
that it allows these non-alphanumeric '$#' array maximum index
varaibles: $#: $#- $#+ so I updated the parser accordingly. Only $#:
seems to be valid in older versions of Perl.</PRE>
<PRE>
-Fixed a rare formatting problem with -lp (and -gnu) which caused
excessive indentation.</PRE>
<PRE>
-Many additional syntax checks have been added.</PRE>
<PRE>
-Revised method for testing here-doc target strings; the following
was causing trouble with a regex test because of the '*' characters:
print <<"*EOF*";
bla bla
*EOF*
Perl seems to allow almost anything to be a here doc target, so an
exact string comparison is now used.</PRE>
<PRE>
-Made update to allow underscores in binary numbers, like '0b1100_0000'.</PRE>
<PRE>
-Corrected problem with scanning certain module names; a blank space was
being inserted after 'warnings' in the following:
use warnings::register;
The problem was that warnings (and a couple of other key modules) were
being tokenized as keywords. They should have just been identifiers.</PRE>
<PRE>
-Corrected tokenization of indirect objects after sort, system, and exec,
after testing produced an incorrect error message for the following
line of code:
print sort $sortsubref @list;</PRE>
<PRE>
-Corrected minor problem where a line after a format had unwanted
extra continuation indentation.</PRE>
<PRE>
-Delete-block-comments (and -dac) now retain any leading hash-bang line</PRE>
<PRE>
-Update for -lp (and -gnu) to not align the leading '=' of a list
with a previous '=', since this interferes with alignment of parameters.</PRE>
<PRE>
old: my $hireDay = new Date;
my $self = {
firstName => undef,
lastName => undef,
hireDay => $hireDay
};
</PRE>
<PRE>
new: my $hireDay = new Date;
my $self = {
firstName => undef,
lastName => undef,
hireDay => $hireDay
};</PRE>
<PRE>
-Modifications made to display tables more compactly when possible,
without adding lines. For example,
old:
'1', "I", '2', "II", '3', "III", '4', "IV",
'5', "V", '6', "VI", '7', "VII", '8', "VIII",
'9', "IX"
new:
'1', "I", '2', "II", '3', "III",
'4', "IV", '5', "V", '6', "VI",
'7', "VII", '8', "VIII", '9', "IX"</PRE>
<PRE>
-Corrected minor bug in which -pt=2 did not keep the right paren tight
around a '++' or '--' token, like this:</PRE>
<PRE>
for ($i = 0 ; $i < length $key ; $i++ )</PRE>
<PRE>
The formatting for this should be, and now is:</PRE>
<PRE>
for ($i = 0 ; $i < length $key ; $i++)</PRE>
<PRE>
Thanks to Erik Thaysen for noting this.</PRE>
<PRE>
-Discovered a new bug involving here-docs during testing! See BUGS.html.</PRE>
<PRE>
-Finally fixed parsing of subroutine attributes (A Perl 5.6 feature).
However, the attributes and prototypes must still be on the same line
as the sub name.</PRE>
<P>
<H2><A NAME="2001 07 31">2001 07 31</A></H2>
<PRE>
-Corrected minor, uncommon bug found during routine testing, in which a
blank got inserted between a function name and its opening paren after
a file test operator, but only in the case that the function had not
been previously seen. Perl uses the existance (or lack thereof) of
the blank to guess if it is a function call. That is,
if (-l pid_filename()) {
became
if (-l pid_filename ()) {
which is a syntax error if pid_filename has not been seen by perl.</PRE>
<PRE>
-If the AutoLoader module is used, perltidy will continue formatting
code after seeing an __END__ line. Use -nlal to deactivate this feature.
Likewise, if the SelfLoader module is used, perltidy will continue
formatting code after seeing a __DATA__ line. Use -nlsl to
deactivate this feature. Thanks to Slaven Rezic for this suggestion.</PRE>
<PRE>
-pod text after __END__ and __DATA__ is now identified by perltidy
so that -dp works correctly. Thanks to Slaven Rezic for this suggestion.</PRE>
<PRE>
-The first $VERSION line which might be eval'd by MakeMaker
is now passed through unchanged. Use -npvl to deactivate this feature.
Thanks to Manfred Winter for this suggestion.</PRE>
<PRE>
-Improved indentation of nested parenthesized expressions. Tests have
given favorable results. Thanks to Wolfgang Weisselberg for helpful
examples.</PRE>
<P>
<H2><A NAME="2001 07 23">2001 07 23</A></H2>
<PRE>
-Fixed a very rare problem in which an unwanted semicolon was inserted
due to misidentification of anonymous hash reference curly as a code
block curly. (No instances of this have been reported; I discovered it
during testing). A workaround for older versions of perltidy is to use
-nasc.</PRE>
<PRE>
-Added -icb (-indent-closing-brace) parameter to indent a brace which
terminates a code block to the same level as the previous line.
Suggested by Andrew Cutler. For example,</PRE>
<PRE>
if ($task) {
yyy();
} # -icb
else {
zzz();
}</PRE>
<PRE>
-Rewrote error message triggered by an unknown bareword in a print or
printf filehandle position, and added flag -w=0 to prevent issuing this
error message. Suggested by Byron Jones.</PRE>
<PRE>
-Added modification to align a one-line 'if' block with similar
following 'elsif' one-line blocks, like this:
if ( $something eq "simple" ) { &handle_simple }
elsif ( $something eq "hard" ) { &handle_hard }
(Suggested by Wolfgang Weisselberg).</PRE>
<P>
<H2><A NAME="2001 07 02">2001 07 02</A></H2>
<PRE>
-Eliminated all constants with leading underscores because perl 5.005_03
does not support that. For example, _SPACES changed to XX_SPACES.
Thanks to kromJx for this update.</PRE>
<P>
<H2><A NAME="2001 07 01">2001 07 01</A></H2>
<PRE>
-the directory of test files has been moved to a separate distribution
file because it is getting large but is of little interest to most users.
For the current distribution:
perltidy-20010701.tgz contains the source and docs for perltidy
perltidy-20010701-test.tgz contains the test files</PRE>
<PRE>
-fixed bug where temporary file perltidy.TMPI was not being deleted
when input was from stdin.</PRE>
<PRE>
-adjusted line break logic to not break after closing brace of an
eval block (suggested by Boris Zentner).</PRE>
<PRE>
-added flag -gnu (--gnu-style) to give an approximation to the GNU
style as sometimes applied to perl. The programming style in GNU
'automake' was used as a guide in setting the parameters; these
parameters will probably be adjusted over time.</PRE>
<PRE>
-an empty code block now has one space for emphasis:
if ( $cmd eq "bg_untested" ) {} # old
if ( $cmd eq "bg_untested" ) { } # new
If this bothers anyone, we could create a parameter.</PRE>
<PRE>
-the -bt (--brace-tightness) parameter has been split into two
parameters to give more control. -bt now applies only to non-BLOCK
braces, while a new parameter -bbt (block-brace-tightness) applies to
curly braces which contain code BLOCKS. The default value is -bbt=0.</PRE>
<PRE>
-added flag -icp (--indent-closing-paren) which leaves a statment
termination of the form );, };, or ]; indented with the same
indentation as the previous line. For example,</PRE>
<PRE>
@month_of_year = ( # default, or -nicp
'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct',
'Nov', 'Dec'
);</PRE>
<PRE>
@month_of_year = ( # -icp
'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct',
'Nov', 'Dec'
);</PRE>
<PRE>
-Vertical alignment updated to synchronize with tokens &&, ||,
and, or, if, unless. Allowable space before forcing
resynchronization has been increased. (Suggested by Wolfgang
Weisselberg).</PRE>
<PRE>
-html corrected to use -nohtml-bold-xxxxxxx or -nhbx to negate bold,
and likewise -nohtml-italic-xxxxxxx or -nhbi to negate italic. There
was no way to negate these previously. html documentation updated and
corrected. (Suggested by Wolfgang Weisselberg).</PRE>
<PRE>
-Some modifications have been made which improve the -lp formatting in
a few cases.</PRE>
<PRE>
-Perltidy now retains or creates a blank line after an =cut to keep
podchecker happy (Suggested by Manfred H. Winter). This appears to be
a glitch in podchecker, but it was annoying.</PRE>
<P>
<H2><A NAME="2001 06 17">2001 06 17</A></H2>
<PRE>
-Added -bli flag to give continuation indentation to braces, like this</PRE>
<PRE>
if ($bli_flag)
{
extra_indentation();
}</PRE>
<PRE>
-Corrected an error with the tab (-t) option which caused the last line
of a multi-line quote to receive a leading tab. This error was in
version 2001 06 08 but not 2001 04 06. If you formatted a script
with -t with this version, please check it by running once with the
-chk flag and perltidy will scan for this possible error.</PRE>
<PRE>
-Corrected an invalid pattern (\R should have been just R), changed
$^W =1 to BEGIN {$^W=1} to use warnings in compile phase, and corrected
several unnecessary 'my' declarations. Many thanks to Wolfgang Weisselberg,
2001-06-12, for catching these errors.
</PRE>
<PRE>
-A '-bar' flag has been added to require braces to always be on the
right, even for multi-line if and foreach statements. For example,
the default formatting of a long if statement would be:</PRE>
<PRE>
if ($bigwasteofspace1 && $bigwasteofspace2
|| $bigwasteofspace3 && $bigwasteofspace4)
{
bigwastoftime();
}</PRE>
<PRE>
With -bar, the formatting is:</PRE>
<PRE>
if ($bigwasteofspace1 && $bigwasteofspace2
|| $bigwasteofspace3 && $bigwasteofspace4) {
bigwastoftime();
}
Suggested by Eli Fidler 2001-06-11.</PRE>
<PRE>
-Uploaded perltidy to sourceforge cvs 2001-06-10.</PRE>
<PRE>
-An '-lp' flag (--line-up-parentheses) has been added which causes lists
to be indented with extra indentation in the manner sometimes
associated with emacs or the GNU suggestions. Thanks to Ian Stuart for
this suggestion and for extensive help in testing it.</PRE>
<PRE>
-Subroutine call parameter lists are now formatted as other lists.
This should improve formatting of tables being passed via subroutine
calls. This will also cause full indentation ('-i=n, default n= 4) of
continued parameter list lines rather than just the number of spaces
given with -ci=n, default n=2.
</PRE>
<PRE>
-Added support for hanging side comments. Perltidy identifies a hanging
side comment as a comment immediately following a line with a side
comment or another hanging side comment. This should work in most
cases. It can be deactivated with --no-hanging-side-comments (-nhsc).
The manual has been updated to discuss this. Suggested by Brad
Eisenberg some time ago, and finally implemented.</PRE>
<P>
<H2><A NAME="2001 06 08">2001 06 08</A></H2>
<PRE>
-fixed problem with parsing command parameters containing quoted
strings in .perltidyrc files. (Reported by Roger Espel Llima 2001-06-07).</PRE>
<PRE>
-added two command line flags, --want-break-after and
--want-break-before, which allow changing whether perltidy
breaks lines before or after any operators. Please see the revised
man pages for details.</PRE>
<PRE>
-added system-wide configuration file capability.
If perltidy does not find a .perltidyrc command line file in
the current directory, nor in the home directory, it now looks
for '/usr/local/etc/perltidyrc' and then for '/etc/perltidyrc'.
(Suggested by Roger Espel Llima 2001-05-31).</PRE>
<PRE>
-fixed problem in which spaces were trimmed from lines of a multi-line
quote. (Reported by Roger Espel Llima 2001-05-30). This is an
uncommon situation, but serious, because it could conceivably change
the proper function of a script.</PRE>
<PRE>
-fixed problem in which a semicolon was incorrectly added within
an anonymous hash. (Reported by A.C. Yardley, 2001-5-23).
(You would know if this happened, because perl would give a syntax
error for the resulting script).</PRE>
<PRE>
-fixed problem in which an incorrect error message was produced
after a version number on a 'use' line, like this ( Reported
by Andres Kroonmaa, 2001-5-14):</PRE>
<PRE>
use CGI 2.42 qw(fatalsToBrowser);</PRE>
<PRE>
Other than the extraneous error message, this bug was harmless.</PRE>
<P>
<H2><A NAME="2001 04 06">2001 04 06</A></H2>
<PRE>
-fixed serious bug in which the last line of some multi-line quotes or
patterns was given continuation indentation spaces. This may make
a pattern incorrect unless it uses the /x modifier. To find
instances of this error in scripts which have been formatted with
earlier versions of perltidy, run with the -chk flag, which has
been added for this purpose (SLH, 2001-04-05).</PRE>
<PRE>
** So, please check previously formatted scripts by running with -chk
at least once **</PRE>
<PRE>
-continuation indentation has been reprogrammed to be hierarchical,
which improves deeply nested structures.</PRE>
<PRE>
-fixed problem with undefined value in list formatting (reported by Michael
Langner 2001-04-05)</PRE>
<PRE>
-Switched to graphical display of nesting in .LOG files. If an
old format string was "(1 [0 {2", the new string is "{{(". This
is easier to read and also shows the order of nesting.</PRE>
<PRE>
-added outdenting of cuddled paren structures, like ")->pack(".</PRE>
<PRE>
-added line break and outdenting of ')->' so that instead of</PRE>
<PRE>
$mw->Label(
-text => "perltidy",
-relief => 'ridge')->pack;
</PRE>
<PRE>
the current default is:</PRE>
<PRE>
$mw->Label(
-text => "perltidy",
-relief => 'ridge'
)->pack;</PRE>
<PRE>
(requested by Michael Langner 2001-03-31; in the future this could
be controlled by a command-line parameter).</PRE>
<PRE>
-revised list indentation logic, so that lists following an assignment
operator get one full indentation level, rather than just continuation
indentation. Also corrected some minor glitches in the continuation
indentation logic.</PRE>
<PRE>
-Fixed problem with unwanted continuation indentation after a blank line
(reported by Erik Thaysen 2001-03-28):</PRE>
<PRE>
-minor update to avoid stranding a single '(' on one line</PRE>
<P>
<H2><A NAME="2001 03 28:">2001 03 28:</A></H2>
<PRE>
-corrected serious error tokenizing filehandles, in which a sub call
after a print or printf, like this:
print usage() and exit;
became this:
print usage () and exit;
Unfortunately, this converts 'usage' to a filehandle. To fix this, rerun
perltidy; it will look for this situation and issue a warning.</PRE>
<PRE>
-fixed another cuddled-else formatting bug (Reported by Craig Bourne)</PRE>
<PRE>
-added several diagnostic --dump routines
</PRE>
<PRE>
-added token-level whitespace controls (suggested by Hans Ecke)</PRE>
<P>
<H2><A NAME="2001 03 23:">2001 03 23:</A></H2>
<PRE>
-added support for special variables of the form ${^WANT_BITS}</PRE>
<PRE>
-space added between scalar and left paren in 'for' and 'foreach' loops,
(suggestion by Michael Cartmell):</PRE>
<PRE>
for $i( 1 .. 20 ) # old
for $i ( 1 .. 20 ) # new</PRE>
<PRE>
-html now outputs cascading style sheets (thanks to suggestion from
Hans Ecke)</PRE>
<PRE>
-flags -o and -st now work with -html</PRE>
<PRE>
-added missing -html documentation for comments (noted by Alex Izvorski)</PRE>
<PRE>
-support for VMS added (thanks to Michael Cartmell for code patches and
testing)</PRE>
<PRE>
-v-strings implemented (noted by Hans Ecke and Michael Cartmell; extensive
testing by Michael Cartmell)</PRE>
<PRE>
-fixed problem where operand may be empty at line 3970
(\b should be just b in lines 3970, 3973) (Thanks to Erik Thaysen,
Keith Marshall for bug reports)</PRE>
<PRE>
-fixed -ce bug (cuddled else), where lines like '} else {' were indented
(Thanks to Shawn Stepper and Rick Measham for reporting this)</PRE>
<P>
<H2><A NAME="2001 03 04:">2001 03 04:</A></H2>
<PRE>
-fixed undefined value in line 153 (only worked with -I set)
(Thanks to Mike Stok, Phantom of the Opcodes, Ian Ehrenwald, and others)</PRE>
<PRE>
-fixed undefined value in line 1069 (filehandle problem with perl versions <
5.6) (Thanks to Yuri Leikind, Mike Stok, Michael Holve, Jeff Kolber)</PRE>
<P>
<H2><A NAME="2001 03 03:">2001 03 03:</A></H2>
<PRE>
-Initial announcement at freshmeat.net; started Change Log
(Unfortunately this version was DOA, but it was fixed the next day)</PRE>
</BODY>
</HTML>
|