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

Roles "consumption" and constant pragma

Thread Next
From:
Marcos Barbeitos
Date:
July 8, 2011 12:50
Subject:
Roles "consumption" and constant pragma
Message ID:
CA+gEHsWG=U6yO9op3yNFz0mXzf0aUPraHMBZe9nJYjiFWs=psQ@mail.gmail.com
Howdy,

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


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
got:


package Roles::Tuple;

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


and:


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


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About