Skip Menu |

This queue is for tickets about the Perl-Tidy CPAN distribution.

Report information
The Basics
Id: 82845
Status: resolved
Priority: 0/
Queue: Perl-Tidy

People
Owner: Nobody in particular
Requestors: TOPHER [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 20121207
Fixed in: (no value)



It appears that, unless I'm missing something, the indentation is off when using the BLOCK form of the package statement, as introduced in 5.14. For example purposes I'm using an input of: package Foo::Bar { use strict; use warnings; use utf8; sub foo { say "Foo."; } 1; } When I run that through perltidy, I get the following: package Foo::Bar { use strict; use warnings; use utf8; sub foo { say "Foo."; } 1; } The odd "hanging indent" of the use statements is particularly jarring. I would have expected something closer to the following (perhaps with an option to match the initial listing): package Foo::Bar { use strict; use warnings; use utf8; sub foo { say "Foo."; } 1; }
Subject: package block indentation
I can't reproduce this - I get what you were expecting: package Foo::Bar { use strict; use warnings; use utf8; sub foo { say "Foo."; } 1; } What version and options are you using? Steve On Mon Jan 21 02:27:14 2013, TOPHER wrote: Show quoted text
> It appears that, unless I'm missing something, the indentation is off > when using the BLOCK form of the package statement, as introduced in
5.14. Show quoted text
> > For example purposes I'm using an input of: > > package Foo::Bar > { > > use strict; > use warnings; > use utf8; > > sub foo { > say "Foo."; > } > > 1; > } > > When I run that through perltidy, I get the following: > > package Foo::Bar { > > use strict; > use warnings; > use utf8; > > sub foo { > say "Foo."; > } > > 1; > } > > The odd "hanging indent" of the use statements is particularly
jarring. Show quoted text
> I would have expected something closer to the following (perhaps with > an option to match the initial listing): > > package Foo::Bar { > > use strict; > use warnings; > use utf8; > > sub foo { > say "Foo."; > } > > 1; > }
On Mon Jan 21 13:14:06 2013, SHANCOCK wrote: Show quoted text
> I can't reproduce this - I get what you were expecting:
[ . . . ] Show quoted text
> What version and options are you using? > Steve
My apologies; it looks like it was a error on my side. I had an old version installed (OS version), and I upgraded it for my perl dev user. Despite the updated perltidy showing up first in the $PATH, it turns out the shell was still using the old version. Running 'hash' verified that it was picking up the system (old) perltidy. After running 'hash -r' to clear it, I'm now correctly hitting the new version and getting the expected behavior.