Search code examples
perlmoose

Does MooseX::Declare require the '{' to be on the same line as 'method'?


This seems to work:

use MooseX::Declare;

class Example {
    method my_method() {

    }
}

This seems to not create the method:

use MooseX::Declare;
class Example {
    method my_method() 
    {

    }
}

Am I missing something, or is it a restriction of MooseX::Declare that the opening curly brace has to go on the same line as 'method'?

--edit--

MooseX::Declare = 0.35

Devel::Declare = 0.006004 - looks like I am down version in Devel::Declare, later versions don't seem to be available within ActiveState perl due to some build issue: http://code.activestate.com/ppm/Devel-Declare/ (up to and including 0.006008)


Solution

  • Yes, that should work. You might have to upgrade Devel::Declare, which does the syntax magic, or MooseX::Declare.