Perltidy Change Log
- 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. All
- suggestions are welcome.
+ 2007 04 24
+ -ole (--output-line-ending) and -ple (--preserve-line-endings) should
+ now work on all systems rather than just unix systems. Thanks to Dan
+ Tyrell.
+
+ -Fixed problem of a warning issued for multiple subs for BEGIN subs
+ and other control subs. Thanks to Heiko Eissfeldt.
+
+ -Fixed problem where no space was introduced between a keyword or
+ bareword and a colon, such as:
+
+ ( ref($result) eq 'HASH' && !%$result ) ? undef: $result;
+
+ Thanks to Niek.
+
+ -Added a utility program 'break_long_quotes.pl' to the examples directory of
+ the distribution. It breaks long quoted strings into a chain of concatenated
+ sub strings no longer than a selected length. Suggested by Michael Renner as
+ a perltidy feature but was judged to be best done in a separate program.
+
+ -Updated docs to remove extra < and >= from list of tokens
+ after which breaks are made by default. Thanks to Bob Kleemann.
+
+ -Removed improper uses of $_ to avoid conflicts with external calls, giving
+ error message similar to:
+ Modification of a read-only value attempted at
+ /usr/share/perl5/Perl/Tidy.pm line 6907.
+ Thanks to Michael Renner.
+
+ -Fixed problem when errorfile was not a plain filename or filehandle
+ in a call to Tidy.pm. The call
+ perltidy(source => \$input, destination => \$output, errorfile => \$err);
+ gave the following error message:
+ Not a GLOB reference at /usr/share/perl5/Perl/Tidy.pm line 3827.
+ Thanks to Michael Renner and Phillipe Bruhat.
+
+ -Fixed problem where -sot would not stack an opening token followed by
+ a side comment. Thanks to Jens Schicke.
+
+ -improved breakpoints in complex math and other long statements. Example:
+ OLD:
+ return
+ log($n) + 0.577215664901532 + ( 1 / ( 2 * $n ) ) -
+ ( 1 / ( 12 * ( $n**2 ) ) ) + ( 1 / ( 120 * ( $n**4 ) ) );
+ NEW:
+ return
+ log($n) + 0.577215664901532 +
+ ( 1 / ( 2 * $n ) ) -
+ ( 1 / ( 12 * ( $n**2 ) ) ) +
+ ( 1 / ( 120 * ( $n**4 ) ) );
+
+ -more robust vertical alignment of complex terminal else blocks and ternary
+ statements.
+
+ 2006 07 19
+ -Eliminated bug where a here-doc invoked through an 'e' modifier on a pattern
+ replacement text was not recognized. The tokenizer now recursively scans
+ replacement text (but does not reformat it).
+
+ -improved vertical alignment of terminal else blocks and ternary statements.
+ thanks to chris for the suggestion.
+
+ OLD:
+ if ( IsBitmap() ) { return GetBitmap(); }
+ elsif ( IsFiles() ) { return GetFiles(); }
+ else { return GetText(); }
+
+ NEW:
+ if ( IsBitmap() ) { return GetBitmap(); }
+ elsif ( IsFiles() ) { return GetFiles(); }
+ else { return GetText(); }
+
+ OLD:
+ $which_search =
+ $opts{"t"} ? 'title'
+ : $opts{"s"} ? 'subject'
+ : $opts{"a"} ? 'author'
+ : 'title';
+
+ NEW:
+ $which_search =
+ $opts{"t"} ? 'title'
+ : $opts{"s"} ? 'subject'
+ : $opts{"a"} ? 'author'
+ : 'title';
+
+ -improved indentation of try/catch blocks and other externally defined
+ functions accepting a block argument. Thanks to jae.
+
+ -Added support for Perl 5.10 features say and smartmatch.
+
+ -Added flag -pbp (--perl-best-practices) as an abbreviation for parameters
+ suggested in Damian Conway's "Perl Best Practices". -pbp is the same as:
+
+ -l=78 -i=4 -ci=4 -st -se -vt=2 -cti=0 -pt=1 -bt=1 -sbt=1 -bbt=1 -nsfs -nolq
+ -wbb="% + - * / x != == >= <= =~ !~ < > | & >= < =
+ **= += *= &= <<= &&= -= /= |= >>= ||= .= %= ^= x="
+
+ Please note that the -st here restricts input to standard input; use
+ -nst if necessary to override.
+
+ -Eliminated some needless breaks at equals signs in -lp indentation.
+
+ OLD:
+ $c =
+ Math::Complex->make(LEFT + $x * (RIGHT - LEFT) / SIZE,
+ TOP + $y * (BOTTOM - TOP) / SIZE);
+ NEW:
+ $c = Math::Complex->make(LEFT + $x * (RIGHT - LEFT) / SIZE,
+ TOP + $y * (BOTTOM - TOP) / SIZE);
+
+ A break at an equals is sometimes useful for preventing complex statements
+ from hitting the line length limit. The decision to do this was
+ over-eager in some cases and has been improved. Thanks to Royce Reece.
+
+ -qw quotes contained in braces, square brackets, and parens are being
+ treated more like those containers as far as stacking of tokens. Also
+ stack of closing tokens ending ');' will outdent to where the ');' would
+ have outdented if the closing stack is matched with a similar opening stack.
+
+ OLD: perltidy -soc -sct
+ __PACKAGE__->load_components(
+ qw(
+ PK::Auto
+ Core
+ )
+ );
+ NEW: perltidy -soc -sct
+ __PACKAGE__->load_components( qw(
+ PK::Auto
+ Core
+ ) );
+ Thanks to Aran Deltac
+
+ -Eliminated some undesirable or marginally desirable vertical alignments.
+ These include terminal colons, opening braces, and equals, and particularly
+ when just two lines would be aligned.
+
+ OLD:
+ my $accurate_timestamps = $Stamps{lnk};
+ my $has_link =
+ ...
+ NEW:
+ my $accurate_timestamps = $Stamps{lnk};
+ my $has_link =
+
+ -Corrected a problem with -mangle in which a space would be removed
+ between a keyword and variable beginning with ::.
2006 06 14
-Attribute argument lists are now correctly treated as quoted strings