Revision history for Perl extension Class-MOP.
0.54
+ * Class::MOP
+ metaclass
+ - making sure that load_class never gets
+ passed a value from @_ or $_ to squash
+ Ovid's bug (http://use.perl.org/~Ovid/journal/35763)
+
* Class::MOP::Class
- make_{immutable,mutable} now return 1
(cause Sartak asked)
my $class = shift;
no strict 'refs';
return 1 if defined ${"${class}::VERSION"} || defined @{"${class}::ISA"};
- foreach (keys %{"${class}::"}) {
- next if substr($_, -2, 2) eq '::';
- return 1 if defined &{"${class}::$_"};
+ foreach my $symbol (keys %{"${class}::"}) {
+ next if substr($symbol, -2, 2) eq '::';
+ return 1 if defined &{"${class}::${symbol}"};
}
return 0;
}
use Carp 'confess';
use Scalar::Util 'blessed';
-our $VERSION = '0.04';
+our $VERSION = '0.05';
our $AUTHORITY = 'cpan:STEVAN';
use Class::MOP;
|| confess "The metaclass ($metaclass) must be derived from Class::MOP::Class";
}
my %options = @_;
- #make sure the custom metaclasses get loaded
- map{ Class::MOP::load_class($options{$_}) }
- grep{ /^(attribute|method|instance)_metaclass/ } keys %options;
+
+ # make sure the custom metaclasses get loaded
+ foreach my $class (grep {
+ /^(attribute|method|instance)_metaclass/
+ } keys %options) {
+ Class::MOP::load_class($options{$class})
+ }
+
my $package = caller();
# create a meta object so we can install &meta