Perl Monk, Perl Meditation | |
PerlMonks |
Re: process run in backgroundby stevieb (Canon) |
on Jul 27, 2016 at 11:59 UTC ( [id://1168637]=note: print w/replies, xml ) | Need Help?? |
I like Proc::Background for this task, as it is cross-platform (*nix and Windows). It's as simple as:
I've used it in a more complex way with start/stop/status functionality with run-in-foreground ability, where the server code is in a module: server module (the bg proc is actually created on line 106), and then a script that starts, stops etc the daemon: server control script. Essentially how it works is that the script is called from the CLI, which in turn executes the module start code, which re-calls the script with a different argument, which calls the listener/network code in the module which is put into the background.
In Section
Seekers of Perl Wisdom
|
|