in reply to perltidy: trying to indent closing brace one level more than the starting indentation

Taking at look at the perltidy sytle key this is the section that you need to refer to, (from web page http://perltidy.sourceforge.net/stylekey.html#braces%20right).

Indentation Style for Other Containers You have a choice of two indentation schemes for non-block containers. + The default is to use a fixed number of spaces per indentation level + (the same number of spaces used for code blocks). Here is an example + of the default: $dbh = DBI->connect( undef, undef, undef, { PrintError => 0, RaiseError => 1 } ); The alternate is to let the location of the opening paren (or square b +racket, or curly brace) define the indentation, like this: $dbh = DBI->connect( undef, undef, undef, { PrintError => 0, RaiseError => 1 } );

If you don't want that extra identation remove the -lp switch.

If you go down the Style key web page it will tell you how to set up all the switches for Perltidy. It presents the options in a if-elsif-else manor making it easy to understand and you go from top to bottom. So you go through the whole page, though you don't implment every switch along the way.

  • Comment on Re: perltidy: trying to indent closing brace one level more than the starting indentation
  • Download Code

Replies are listed 'Best First'.
Re^2: perltidy: trying to indent closing brace one level more than the starting indentation
by Argel (Prior) on Apr 03, 2006 at 20:25 UTC
    Thanks for the link! I went through perldoc perltidy before posting and I just went through the very nice page you linked to. However. looks like -l=0 is the only way to get the closing brace to line up with the block indentation. Thanks for the help though!!