package MyOleTypeLib; use Moose::Util::TypeConstraints; sub isDictionary { my $val = shift; return 0 unless $val->isa('Win32::OLE'); my @lst = Win32::OLE->QueryObjectType($val); return ( $lst[0] eq 'TSATLLib' # different for real ... and $lst[1] eq 'ITSEnt'); # ... VBS dictionary } subtype 'Dictionary', as 'Object', where { isDictionary($_) }, message { "$_ is not a OLE-Dictionary!"}; # in my Class: class Dictionary { has '_DictObj' => ( isa => 'Dictionary', ...