Skip to content

Commit

Permalink
Added a "no warnings 'redefine'" to method() and methods() in
Browse files Browse the repository at this point in the history
Badger::Class.
  • Loading branch information
klesteb committed May 17, 2016
1 parent cfb219c commit c312cd9
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/Badger/Class.pm
Original file line number Diff line number Diff line change
Expand Up @@ -663,6 +663,7 @@ sub method {
my $self = shift;
my $name = shift;
no strict REFS;
no warnings 'redefines';

# method($name) can be used to fetch a method/sub
return $self->{ name }->can($name)
Expand All @@ -684,6 +685,7 @@ sub methods {
my $args = @_ && ref $_[0] eq HASH ? shift : { @_ };
my $pkg = $self->{ name };
no strict REFS;
no warnings 'redefines';

while (my ($name, $code) = each %$args) {
_debug("defining method: $self\::$name => $code\n") if DEBUG;
Expand Down

0 comments on commit c312cd9

Please sign in to comment.