Search code examples
perlperl-modulemoose

Moose Variable names may not contain :: at


So I hit this weird error.

Variable names may not contain :: at .../perl5/lib/perl5/x86_64-cygwin-threads-multi/Class/MOP/Package.pm

The code that triggers it is:

override 'emitEvent::ENOTE::Final' => sub {
my ($self, $e) = @_;
my ($rval);

$rval = super();


return($rval);
};

I found this link regarding a bug: http://codeverge.com/perl.perl5.porters/a-very-old-bug-in-safe.pm/2018166

Is this related?

If I take the '::' out, it goes away, but really messes with the way I've been naming things, so if there's a workaround, I'd appreciate it.

-E


Solution

  • override's first argument must be the (unqualified) method name of an inherited method.

    emitEvent::ENOTE::Final is not an acceptable Perl method name because Perl would take that to mean the method named Final in package emitEvent::ENOTE. If you fooled something in creating a method called that, you should fix that.