Ah, OK. That points to use Avbrief::TypeConstraints; There is a comment in this file that looks promising - So I deleted the 'old' lines as described

=head1 ArrayRefs of types this feature was added to Moose sometime after 0.17 which shipped with + etch please uncomment the lines below when our system have migrated to lenn +y or a later Moose Moose::Util::TypeConstraints->create_parameterized_type_constraint ('A +rrayRef[ReadableDir]'); Moose::Util::TypeConstraints->create_parameterized_type_constraint ('A +rrayRef[WritableDir]'); Moose::Util::TypeConstraints->create_parameterized_type_constraint ('A +rrayRef[ReadableFile]'); Moose::Util::TypeConstraints->create_parameterized_type_constraint ('A +rrayRef[WritableFile]'); Moose::Util::TypeConstraints->create_parameterized_type_constraint ('A +rrayRef[WritablePath]'); Moose::Util::TypeConstraints->create_parameterized_type_constraint ('A +rrayRef[File]'); Moose::Util::TypeConstraints->create_parameterized_type_constraint ('A +rrayRef[Dir]'); then you can delete the types defined the 'old' way below =cut subtype 'ArrayRef[ReadableDir]' => as 'ArrayRef' => where { foreach(@$_) { return unless -d $_; return unless -r $_; } return 1; } => message { "One of the directorys in the array is not readable!" }; subtype 'ArrayRef[WritableDir]' => as 'ArrayRef' => where { etc etc etc
And now get
Class::MOP::Class::Immutable::Trait #### Class/MOP/Class/Immutable/Trait.pm **** Avbrief::EAD::Processor #### Avbrief/EAD/Processor.pm **** Couldn't load class (Avbrief::EAD::Processor) because: Could not parse + type name (Moose::Util::TypeConstraints) correctly at /usr/lib/perl5 +/Moose/Util/TypeConstraints.pm line 104 Moose::Util::TypeConstraints::create_parameterized_type_constr +aint('Moose::Util::TypeConstraints', 'ArrayRef[ReadableDir]') called +at /usr/share/perl5/Avbrief/TypeConstraints.pm line 72 require Avbrief/TypeConstraints.pm called at /usr/share/perl5/ +Avbrief/EAD/Processor.pm line 3 Avbrief::EAD::Processor::BEGIN() called at /usr/share/perl5/Av +brief/TypeConstraints.pm line 0 eval {...} called at /usr/share/perl5/Avbrief/TypeConstraints. +pm line 0 require Avbrief/EAD/Processor.pm called at /usr/lib/perl5/Clas +s/MOP.pm line 118 Class::MOP::__ANON__() called at /usr/share/perl5/Try/Tiny.pm +line 71 eval {...} called at /usr/share/perl5/Try/Tiny.pm line 67 Try::Tiny::try('CODE(0x9a2e5b0)', 'Try::Tiny::Catch=REF(0x9f68 +570)') called at /usr/lib/perl5/Class/MOP.pm line 129 Class::MOP::load_first_existing_class('Avbrief::EAD::Processor +') called at /usr/lib/perl5/Class/MOP.pm line 141 Class::MOP::load_class('Avbrief::EAD::Processor', undef) calle +d at /usr/lib/perl5/Moose/Meta/Class.pm line 288 Moose::Meta::Class::superclasses(undef, 'Avbrief::EAD::Process +or') called at /usr/lib/perl5/Moose.pm line 54 Moose::extends('Moose::Meta::Class=HASH(0x9edefa0)', 'Avbrief: +:EAD::Processor') called at /usr/lib/perl5/Moose/Exporter.pm line 294 Moose::extends('Avbrief::EAD::Processor') called at /usr/share +/perl5/Avbrief/EAD/TAM/Processor.pm line 10 require Avbrief/EAD/TAM/Processor.pm called at /avprog/bin/pro +cess_eadesi_tam.pl line 4 main::BEGIN() called at /usr/share/perl5/Avbrief/TypeConstrain +ts.pm line 0 eval {...} called at /usr/share/perl5/Avbrief/TypeConstraints. +pm line 0 Compilation failed in require at /usr/share/perl5/Avbrief/EAD/Processo +r.pm line 3. BEGIN failed--compilation aborted at /usr/share/perl5/Avbrief/EAD/Proc +essor.pm line 3. Compilation failed in require at /usr/lib/perl5/Class/MOP.pm line 118. at /usr/lib/perl5/Class/MOP.pm line 124 Class::MOP::__ANON__('Could not parse type name (Moose::Util:: +TypeConstraints) corr...') called at /usr/share/perl5/Try/Tiny.pm lin +e 98 Try::Tiny::try('CODE(0x9a2e5b0)', 'Try::Tiny::Catch=REF(0x9f68 +570)') called at /usr/lib/perl5/Class/MOP.pm line 129 Class::MOP::load_first_existing_class('Avbrief::EAD::Processor +') called at /usr/lib/perl5/Class/MOP.pm line 141 Class::MOP::load_class('Avbrief::EAD::Processor', undef) calle +d at /usr/lib/perl5/Moose/Meta/Class.pm line 288 Moose::Meta::Class::superclasses(undef, 'Avbrief::EAD::Process +or') called at /usr/lib/perl5/Moose.pm line 54 Moose::extends('Moose::Meta::Class=HASH(0x9edefa0)', 'Avbrief: +:EAD::Processor') called at /usr/lib/perl5/Moose/Exporter.pm line 294 Moose::extends('Avbrief::EAD::Processor') called at /usr/share +/perl5/Avbrief/EAD/TAM/Processor.pm line 10 require Avbrief/EAD/TAM/Processor.pm called at /avprog/bin/pro +cess_eadesi_tam.pl line 4 main::BEGIN() called at /usr/share/perl5/Avbrief/EAD/TAM/Proce +ssor.pm line 0 eval {...} called at /usr/share/perl5/Avbrief/EAD/TAM/Processo +r.pm line 0 Compilation failed in require at /avprog/bin/process_eadesi_tam.pl lin +e 4. BEGIN failed--compilation aborted at /avprog/bin/process_eadesi_tam.pl + line 4.

In reply to Re^2: Moose - MOP.pm funny by martinm
in thread Moose - MOP.pm funny by martinm

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.