in reply to Re: Passing a hash plus some strings to a subroutine
in thread Passing a hash plus some strings to a subroutine

but yeah, the real problem here is perlcritic enforcing old PBP rules here.

Is there another tool which would be more appropriate to run?

  • Comment on Re^2: Passing a hash plus some strings to a subroutine

Replies are listed 'Best First'.
Re^3: Passing a hash plus some strings to a subroutine
by LanX (Saint) on Dec 20, 2025 at 12:18 UTC
    Sorry, I'm the wrong one to ask about Perl::Critic - I don't use it.

    I know that many companies expand/restrict the rule sets to their liking in order to have coherent internal style.

    And PBP itself described its rules only as suggestions, IIRC.

    Anyway, what Fletch showed you is the standard vanilla approach which will always work.

    Cheers Rolf
    (addicted to the Perl Programming Language :)
    see Wikisyntax for the Monastery

Re^3: Passing a hash plus some strings to a subroutine
by choroba (Cardinal) on Dec 20, 2025 at 21:14 UTC
    perlcritic is fully configurable. If you disagree with a policy, you can turn it off.

    See also Perl::Critic::Community for a revised and modernised set of perlcritic rules, created mostly by the IRC subset of the Perl community.

    map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]