Subject: | isa => 'SomeClass', handles => qr// dies if SomeClass isn't loaded |
If you have an attribute with "isa => 'SomeClass', handles =>
qr/\w_class/, you get a backtrace like the following if SomeClass isn't
loaded:
Couldn't load class (VCI::Abstract::Project) because:
VCI::Abstract::Project already has a metaclass, but it does not inherit
Moose::Meta::Class (Class::MOP::Class=HASH(0x36b13b0)). at
/usr/lib64/perl5/vendor_perl/5.10.0/x86_64-linux-thread-multi/Moose.pm
line 166
Moose::init_meta('Moose', 'for_class', 'VCI::Abstract::Project',
'metaclass', undef) called at
/usr/lib64/perl5/vendor_perl/5.10.0/x86_64-linux-thread-
multi/Moose/Exporter.pm line 354
Moose::Exporter::__ANON__('Moose') called at
lib/VCI/Abstract/Project.pm line 2
VCI::Abstract::Project::BEGIN() called at
lib/VCI/Abstract/Project.pm line 2
eval {...} called at lib/VCI/Abstract/Project.pm line 2
require VCI/Abstract/Project.pm called at
/usr/lib64/perl5/vendor_perl/5.10.0/x86_64-linux-thread-
multi/Class/MOP.pm line 114
Class::MOP::__ANON__() called at
/usr/lib/perl5/vendor_perl/5.10.0/Try/Tiny.pm line 71
eval {...} called at
/usr/lib/perl5/vendor_perl/5.10.0/Try/Tiny.pm line 67
Try::Tiny::try('CODE(0x300c308)',
'Try::Tiny::Catch=REF(0x399eb60)') called at
/usr/lib64/perl5/vendor_perl/5.10.0/x86_64-linux-thread-
multi/Class/MOP.pm line 125
Class::MOP::load_first_existing_class('VCI::Abstract::Project')
called at /usr/lib64/perl5/vendor_perl/5.10.0/x86_64-linux-thread-
multi/Class/MOP.pm line 137
Class::MOP::load_class('VCI::Abstract::Project', undef) called
at /usr/lib64/perl5/vendor_perl/5.10.0/x86_64-linux-thread-
multi/Moose/Meta/Class.pm line 288
Moose::Meta::Class::superclasses(undef,
'VCI::Abstract::Project') called at
/usr/lib64/perl5/vendor_perl/5.10.0/x86_64-linux-thread-multi/Moose.pm
line 53
Moose::extends('Moose::Meta::Class=HASH(0x3019b90)',
'VCI::Abstract::Project') called at
/usr/lib64/perl5/vendor_perl/5.10.0/x86_64-linux-thread-
multi/Moose/Exporter.pm line 293
Moose::extends('VCI::Abstract::Project') called at
lib/VCI/VCS/Bzr/Project.pm line 9
require VCI/VCS/Bzr/Project.pm called at
lib/VCI/VCS/Bzr/Repository.pm line 5
VCI::VCS::Bzr::Repository::BEGIN() called at
lib/VCI/Abstract/Project.pm line 2
eval {...} called at lib/VCI/Abstract/Project.pm line 2
require VCI/VCS/Bzr/Repository.pm called at - line 0
main::BEGIN() called at lib/VCI/Abstract/Project.pm line 2
eval {...} called at lib/VCI/Abstract/Project.pm line 2
BEGIN failed--compilation aborted at lib/VCI/Abstract/Project.pm line 2.
Compilation failed in require at
/usr/lib64/perl5/vendor_perl/5.10.0/x86_64-linux-thread-
multi/Class/MOP.pm line 114.
at /usr/lib64/perl5/vendor_perl/5.10.0/x86_64-linux-thread-
multi/Class/MOP.pm line 120
Class::MOP::__ANON__('VCI::Abstract::Project already has a
metaclass, but it does n...') called at
/usr/lib/perl5/vendor_perl/5.10.0/Try/Tiny.pm line 98
Try::Tiny::try('CODE(0x300c308)',
'Try::Tiny::Catch=REF(0x399eb60)') called at
/usr/lib64/perl5/vendor_perl/5.10.0/x86_64-linux-thread-
multi/Class/MOP.pm line 125
Class::MOP::load_first_existing_class('VCI::Abstract::Project')
called at /usr/lib64/perl5/vendor_perl/5.10.0/x86_64-linux-thread-
multi/Class/MOP.pm line 137
Class::MOP::load_class('VCI::Abstract::Project', undef) called
at /usr/lib64/perl5/vendor_perl/5.10.0/x86_64-linux-thread-
multi/Moose/Meta/Class.pm line 288
Moose::Meta::Class::superclasses(undef,
'VCI::Abstract::Project') called at
/usr/lib64/perl5/vendor_perl/5.10.0/x86_64-linux-thread-multi/Moose.pm
line 53
Moose::extends('Moose::Meta::Class=HASH(0x3019b90)',
'VCI::Abstract::Project') called at
/usr/lib64/perl5/vendor_perl/5.10.0/x86_64-linux-thread-
multi/Moose/Exporter.pm line 293
Moose::extends('VCI::Abstract::Project') called at
lib/VCI/VCS/Bzr/Project.pm line 9
require VCI/VCS/Bzr/Project.pm called at
lib/VCI/VCS/Bzr/Repository.pm line 5
VCI::VCS::Bzr::Repository::BEGIN() called at
lib/VCI/VCS/Bzr/Project.pm line 0
eval {...} called at lib/VCI/VCS/Bzr/Project.pm line 0
require VCI/VCS/Bzr/Repository.pm called at - line 0
main::BEGIN() called at lib/VCI/VCS/Bzr/Project.pm line 0
eval {...} called at lib/VCI/VCS/Bzr/Project.pm line 0
Compilation failed in require at lib/VCI/VCS/Bzr/Repository.pm line 5.
BEGIN failed--compilation aborted at lib/VCI/VCS/Bzr/Repository.pm line
5.
Compilation failed in require.
BEGIN failed--compilation aborted.