>> Why doesn't use work?

> That does work, there are several examples on CPAN of where it *has*
> to work since that is shipped code. You'll need to provide more
> details about the error you're getting for help figuring out what is
> going on.

OK, here's an example that is broken on my work laptop.  What am I doing
wrong?  I don't think it's a syntax error, is it?

package Two; # (file called Two.pm)

use Moose;

has 'c' => {
        is => 'ro',
        isa => 'Str',
        required => 1,
};

1;

package One; # (file called One.pm)

use Moose;
use Two;

has 'a' => {
        is => 'ro',
        isa => 'Str',
        required => 1
};

has 'b' => {
        is => 'ro',
        isa => 'Two',
        required => 1
};

1;

Here's the stack trace that perl -wc One.pm throws:

C:\projects\moose>perl -wc One.pm
Usage: has 'name' => ( key => value, ... ) at C:/Perl/site/lib/Moose.pm line 64
        Moose::has('Moose::Meta::Class=HASH(0x1f33234)', 'c', 'HASH(0x1f33ae4)')
 called at C:/Perl/site/lib/Moose/Exporter.pm line 288
        Moose::has('c', 'HASH(0x1f33ae4)') called at Two.pm line 6
        require Two.pm called at One.pm line 5
        One::BEGIN() called at Two.pm line 0
        eval {...} called at Two.pm line 0
Compilation failed in require at One.pm line 5.
BEGIN failed--compilation aborted at One.pm line 5.

I'm using ActiveState 5.10.1 (build 1006) with the Moose-0.92 PPM

I tried this at home last night with Camelbox and got the same error.

Thank you.

--Mark

Reply via email to