0

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

Erik Bennett
  • 1,049
  • 6
  • 15

1 Answers1

5

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.

ikegami
  • 367,544
  • 15
  • 269
  • 518
  • Yeah. I was porting some other code to "Moose-ify" it. I restructured the code while I was porting it, so it turns out that the fix was really pretty quick. Thanks. – Erik Bennett Mar 10 '19 at 10:36