develooper Front page | perl.moose | Postings from July 2011

Roles "consumption" and constant pragma

Thread Next
Marcos Barbeitos
July 8, 2011 12:50
Roles "consumption" and constant pragma
Message ID:

New to Moose, ran into something curious. Somewhere in the application I

package Constants;

use constant TRUE => 1;
use constant FALSE => 0;

I know, I've read several postings of people grumbling that 1 in Perl means
true and 0 means false and to just get over it.  However, somewhere else I

package Roles::Tuple;

use Moose::Role;
use Constants;
use Check;


package Roles::Schema;

use Moose::Role;
use Constants
use Check;

and then I have:

package Tuple;

use Moose;
with 'Roles::Tuple', 'Roles::Schema';

If I try 'use Tuple'  I get:

'Due to method name conflicts in roles 'Roles::Schema' and 'Roles::Tuple',
the methods 'FALSE' and 'TRUE' must be implemented or excluded by 'Tuple''

Both 'Constants' and 'Check', which are used by 'Roles::Schema' and
'Roles::Tuple' also export several other variables and subroutines, but I
only run into problems with the constants TRUE and FALSE.

Any help will be greatly appreciated.  Cheers!

Marcos S. Barbeitos
Post-doctoral researcher
American Museum of Natural History
Department of Invertebrate Zoology
79 St and Central Park West
New York, NY 10024

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About