Perl::Critic && Perltidy

kaare on 2007-10-31T11:08:14

Two issues emerged from Jonas' Perl::Critic talk at yesterdays CPH.pm meeting.

Straying away from the topic, I learned that Perltidy won't accept Error.pm's try/catch/otherwise as a control structure and consequently doesn't format it the way I like. I like to cuddle my elses (yes, I'm that kind of guy) and would like this formatting for a try block

try {

do something

} catch ... with {

do something

} otherwise {

do something

};

but it seems that Perltidy can't do that. Can anyone confirm this?

The other issue is that Perl::Critic fails make test. I tried on a fairly OK Perl installation, and I see that this issue already has been reported:

t/20_policies.............................NOK 69/682 # Failed test 'BuiltinFunctions::RequireGlobFunction - line 19 - Multiple globs via <...>' # at t/20_policies.t line 95. # got: '2' # expected: '1' # Violation found: Glob written as <...> at line 2, column 11. See page 167 of PBP. # Violation found: Glob written as <...> at line 2, column 19. See page 167 of PBP.


I haven't used Error.pm

sigzero on 2007-10-31T13:40:08

"try/catch/otherwise"

They named it "otherwise"? Really?

1.078 test fail

ChrisDolan on 2007-11-01T03:09:44

This problem is because I fixed a bug in PPI v1.200 that the Perl:Critic test relied on. :-)

The next P::C will fix it, or you can downgrade PPI (I don't recommend that) or you can ignore the test failure.