Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

perl

moose

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)

like image 751
lexicalscope Avatar asked Oct 10 '22 00:10

lexicalscope


1 Answers

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

like image 115
Schwern Avatar answered Oct 13 '22 10:10

Schwern