note
stvn
<P>
This question got answered in #moose on IRC, but just so that Perlmonks has the answer, here you go.
</P>
<P>
The conflict is in the [cpan://Moose] export &with and the [cpan://Error] export &with. There are a couple of solutions possible:
<UL>
<LI>Since [cpan://Moose] uses [cpan://Sub::Exporter] it is possible to rename &with in the export, like so:
<code>
package Foo::Role;
use Moose::Role;
package Foo;
use Moose with => { -as => "moose_with" };
use Error qw(:try)
moose_with("Foo::Role");
Foo->does("Foo::Role") # returns true
</code></LI>
<LI>Or, use a different Exception module, [cpan://Exception::Class] is an excellent choice and known to work work just fine with [cpan://Moose].</LI>
</UL>
</P>
<div class="pmsig"><div class="pmsig-315586">
-stvn
</div></div>
675049
675049