Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Problems with overriding a Perl::Critic policy

by Anonymous Monk
on Sep 22, 2013 at 04:37 UTC ( #1055162=note: print w/ replies, xml ) Need Help??


in reply to Problems with overriding a Perl::Critic policy - SOLVED

Untested. Just an idea:

require Subroutines::RequireArgUnpack; # Add a fake parent. unshift @Subroutines::RequireArgUnpack::ISA = 'Subroutines::RequireArg +Unpack::Fake'; # Put method you want to override in fake parent. *Subroutines::RequireArgUnpack::Fake = \&Subroutines::RequireArgUnpack +::violates; # Override method in original class. *Subroutines::RequireArgUnpack::violates = sub { my ($self, @args) = @_; # Maybe call overriden method. $self->SUPER::violates(@args); };


Comment on Re: Problems with overriding a Perl::Critic policy
Download Code
Replies are listed 'Best First'.
Re^2: Problems with overriding a Perl::Critic policy
by Grimy (Pilgrim) on Sep 22, 2013 at 10:15 UTC
    I donít understand what youíre trying to do. Care to explain how this idea would allow one to exclude Subroutines::RequireArgUnpack, but to include the subclass? Whatís the purpose of the fake parent?

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1055162]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (10)
As of 2015-07-08 08:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (96 votes), past polls