I haven't read through the rewrite.
What I meant about passing a code reference is using an anonymous sub.
# create code reference my $anon_sub = sub { print "Hello world!\n" }; # execute the code $anon_sub->();
For Daemonize, it would look something like...
my $run = sub { die 'unfinished' }; my $d = Daemonize->new( run => $run ); # later, inside Daemonize $self->{run}->( $self );
I think it would be a good idea to pass the Daemonize object to the sub itself (as I did in the example) so it can call methods on it (like logging) if it wants to.
I'm not quite clear about what you're trying to do with $SIG{__DIE__}, but you might want an END block or a DESTROY method instead.
In reply to Re^3: Demonize Module, What are your thoughts?
by kyle
in thread Demonize Module, What are your thoughts?
by halfbaked
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |