Perl-Tidy

 view release on metacpan or  search on metacpan

CHANGES.md  view on Meta::CPAN

      
      perltidy -csc -cscb

      } ## end foreach my $foo (sort { $b cmp $a ... })
      
     Since there is much to be gained and little to be lost by doing this,
     the default is B<-cscb>.  Use B<-ncscb> if you do not want this.

     Thanks to Daniel Becker for suggesting this option.

    - After an isolated closing eval block the continuation indentation will be
      removed so that the braces line up more like other blocks.  Thanks to Yves Orton.

    OLD:
       eval {
           #STUFF;
           1;    # return true
         }  
         or do {
           #handle error
         };

    NEW:
       eval {
           #STUFF;
           1;    # return true
       } or do {
           #handle error
       };

    -A new flag -asbl (or --opening-anonymous-sub-brace-on-new-line) has
     been added to put the opening brace of anonymous sub's on a new line,
     as in the following snippet:

       my $code = sub
       {
           my $arg = shift;
           return $arg->(@_);
       };

     This was not possible before because the -sbl flag only applies to named
     subs. Thanks to Benjamin Krupp.

    -Fix tokenization bug with the following snippet
      print 'hi' if { x => 1, }->{x};
     which resulted in a semicolon being added after the comma.  The workaround
     was to use -nasc, but this is no longer necessary.  Thanks to Brian Duggan. 

    -Fixed problem in which an incorrect error message could be triggered
    by the (unusual) combination of parameters  -lp -i=0 -l=2 -ci=0 for
    example.  Thanks to Richard Jelinek.

    -A new flag --keep-old-blank-lines=n has been added to
    give more control over the treatment of old blank lines in
    a script.  The manual has been revised to discuss the new
    flag and clarify the treatment of old blank lines.  Thanks
    to Oliver Schaefer.

## 2007 12 05

    -Improved support for perl 5.10: New quote modifier 'p', new block type UNITCHECK, 
    new keyword break, improved formatting of given/when.

    -Corrected tokenization bug of something like $var{-q}.

    -Numerous minor formatting improvements.

    -Corrected list of operators controlled by -baao -bbao to include
      . : ? && || and or err xor

    -Corrected very minor error in log file involving incorrect comment
    regarding need for upper case of labels.  

    -Fixed problem where perltidy could run for a very long time
    when given certain non-perl text files.

    -Line breaks in un-parenthesized lists now try to follow
    line breaks in the input file rather than trying to fill
    lines.  This usually works better, but if this causes
    trouble you can use -iob to ignore any old line breaks.
    Example for the following input snippet:

       print
       "conformability (Not the same dimension)\n",
       "\t", $have, " is ", text_unit($hu), "\n",
       "\t", $want, " is ", text_unit($wu), "\n",
       ;

     OLD:
       print "conformability (Not the same dimension)\n", "\t", $have, " is ",
         text_unit($hu), "\n", "\t", $want, " is ", text_unit($wu), "\n",;

     NEW:
       print "conformability (Not the same dimension)\n",
         "\t", $have, " is ", text_unit($hu), "\n",
         "\t", $want, " is ", text_unit($wu), "\n",
         ;

## 2007 08 01

    -Added -fpsc option (--fixed-position-side-comment). Thanks to Ueli Hugenschmidt. 
    For example -fpsc=40 tells perltidy to put side comments in column 40
    if possible.  

    -Added -bbao and -baao options (--break-before-all-operators and
    --break-after-all-operators) to simplify command lines and configuration
    files.  These define an initial preference for breaking at operators which can
    be modified with -wba and -wbb flags.  For example to break before all operators
    except an = one could use --bbao -wba='=' rather than listing every
    single perl operator (except =) on a -wbb flag.

    -Added -kis option (--keep-interior-semicolons).  Use the B<-kis> flag
    to prevent breaking at a semicolon if there was no break there in the
    input file.  To illustrate, consider the following input lines:

       dbmclose(%verb_delim); undef %verb_delim;
       dbmclose(%expanded); undef %expanded;
       dbmclose(%global); undef %global;

    Normally these would be broken into six lines, but 
    perltidy -kis gives:



( run in 0.465 second using v1.01-cache-2.11-cpan-5b529ec07f3 )