in reply to Daemon with Net::Daemon
Then you could simply use IO::Socket::INET to create a socket that connects to the above server and reads/writes commands to it.$SIG{CHLD}='IGNORE'; # no zombies for me! use IO::Socket; my $server = new IO::Socket::INET ( LocalPort=>2000, LocalAddr=>'127.0.0.1', Type=>SOCK_STREAM, Reuse=>1, Listen=>10, ); while(my $client = $server->accept) { my $pid = fork; next if $pid; # # This is the body of the forked child, # simply read from the client using <$client> # and write using print $client foo; # then exit the child (DO NOT FORGET); exit; }
|
|---|