Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

Re: Perl Critic and a formatting question.

by choroba (Chancellor)
on Apr 29, 2013 at 08:27 UTC ( #1031183=note: print w/replies, xml ) Need Help??

in reply to Perl Critic and a formatting question.

Any suggestions would be appreciated.
Do not run perlcritic in brutal mode. What's the prize?

Jokes aside:

If you run perlcritic with --verbose 10, it will give you some explanation:
Code is not tidy at line 1, column 1. CodeLayout::RequireTidyCode (Severity: 1) Conway does make specific recommendations for whitespace and curly-braces in your code, but the most important thing is to adop +t a consistent layout, regardless of the specifics. And the easiest wa +y to do that is to use Perl::Tidy. This policy will complain if you're +code hasn't been run through Perl::Tidy.

If you run perltidy on the code, you will get two more spaces after $VERSION and the complaint will disappear. Go figure.

لսႽ ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ

Replies are listed 'Best First'.
Re^2: Perl Critic and a formatting question.
by Anonymous Monk on Apr 29, 2013 at 08:50 UTC
    Hi choroba.


    I should have seen that minor fix but fatigue is the culprit (1:48am here).

    P.S: I hope my rudimentary knowledge of Czech was correct and displayed properly in your browser.

Re^2: Perl Critic and a formatting question.
by B-Man (Acolyte) on Apr 30, 2013 at 17:38 UTC

    Oh. I see what the complaint is about and why it disappears! Take a look at these two lines of code:

    our @EXPORT_OK = qw/&greet/; our $VERSION = '0.1';

    The assignment operators (=) don't line up. When perltidy adds the spaces, it's creating whitespace that aligns those operators.

    our @EXPORT_OK = qw/&greet/; our $VERSION = '0.1';

    Now the the code is tidy and the assignment operators are aligned, perlcritic stops complaining.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1031183]
choroba waits
[thepkd]: $aohoaoh ->{'foo'} has to be dereferenced to access its contents right?
[thepkd]: sorry. i mean $aohoaoh[0]
[GotToBTru]: $aohoaoh is an array reference tho
[thepkd]: some guy was suggesting $aohoaoh[0]->{'foo '}[0]->{}. This wouldnt work.
[GotToBTru]: you're mixing notation there I think
[GotToBTru]: $aohoaoh->[0] is a hash reference, so $aohoaoh->[0]->{ key1} would work
[1nickt]: If 1nickt is the some guy, that's not what he said.

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (11)
As of 2016-12-06 13:35 GMT
Find Nodes?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:

    Results (104 votes). Check out past polls.