Search code examples
perlmoose

Scalar found where operator expected at <script>


use Moose;

extends 'TEST::Role';

has 'name' => (
    is => 'ro',
    isa => 'Str',
    default => 'me',
);

This works in perl 5.8.5 but not in 5.8.8.

How to resolve it?

String found where operator expected at B.PM line 4, near "extends 'TEST::Role'"
        (Do you need to predeclare extends?)

Solution

  • If you can get this into a failing test and post it to either the Moose mailing list, or #moose on irc.perl.org I'm sure someone can help sort out what is going on.

    Please be sure to include all of the code, your package declaration is missing here (and as a first hint, I wouldn't name my package B because that collides with a core package).