Subject: | Can't inherit start() from role MooseX::Daemonize |
This code:
use MooseX::Declare;
class Foo with MooseX::Daemonize {
after start { $self->printout();}
method printout(){
print "test\n";
die "Autsch";
}
}
fails with The method 'start' was not found in the inheritance
hierarchy for Foo at /home/mhentsc3/perl510/lib/site_perl/5.10.0/x86_64-
linux/Class/MOP/Class.pm line 660
This code should behave similar to the following code:
package Foo;
use Moose;
with 'MooseX::Daemonize';
after 'start' => sub { my $self = shift @_; $self->printout();};
sub printout { my $self = shift @_; print "hello\n"; die "autsch";}
1;
package main;
my $x = Foo->new(pidfile => '/tmp/foo.pid');
$x->start();
The second code snippet works.