RobinV has asked for the wisdom of the Perl Monks concerning the following question:

Hello Monks,
I am coding in perl for a While now and I really like it
However I need to make one app now that Does DBuss as a daemon and I aint sure how to do this.
I think I am all off.. I cant seem to get the perl -d function to work how I want it and thus I'll just wonder if anyone can shed some light upon my beacon?

Here is my code:
#!/usr/bin.perl -w use strict; use warnings; use Proc::Daemon; use Proc::PID::File; #Use DBus use Net::DBus; use Net::DBus::Service; use Net::DBus::Reactor; use Net::DBus::Exporter qw(com.analyse); Proc::Daemon::Init(); if (Proc::PID::File->running()) { exit(0); } #Do Init my @stack = (); my $pid = fork(); if(!defined $pid) { print "Can't Fork\n"; #Write to Log } elsif ($pid == 0) { #Child for(;;) { #Listern here to new thing to connect to my DBus? sleep 1; } } else { #MasterProcess my $Master_Bus = Net::DBus->session(); my $service = $Master_Bus->export_service("com.analyse"); my $object = DBusEnvelope->new($service); for(;;) { #Add New Data from DBus to the Stack var and Execute the next one f +rom stack in the script. my $react = Net::DBus::Reactor->main(); #I think I;;need to make a +function called Main now.. but I aitn sure. $react->run(); #exec ./script -argv [ pop(@stack) ]; sleep 1; } #waitpid($pid,0); }
Can anyone help me fix this DBus/Daemon thing?