Skip to content

Commit

Permalink
warn if attributes are redefined
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Aug 10, 2012
1 parent cf2c6d8 commit fabc833
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions lib/Mojo/Base.pm
Expand Up @@ -20,7 +20,6 @@ sub import {

# No limits!
no strict 'refs';
no warnings 'redefine';

# Base
if ($flag eq '-base') { $flag = $class }
Expand Down Expand Up @@ -96,9 +95,8 @@ sub attr {

# We compile custom attribute code for speed
no strict 'refs';
no warnings 'redefine';
Carp::croak("Mojo::Base error: $@") unless eval "$code;1";
warn "-- Attribute $attr in $class\n$code\n\n" if $ENV{MOJO_BASE_DEBUG};
Carp::croak("Mojo::Base error: $@") unless eval "$code;1";
}
}

Expand Down

0 comments on commit fabc833

Please sign in to comment.