I have a POE based IRC bot that uses "modules" for command sets. The core bot script loads *.pm files in the plugins directory of the bot's home directory.
I want to have one module that can read a config and send xxx text to xxx channel(s) every xxx minutes. But it has to be launched in the background so that loading modules can continue.
I have done a while(1) loop but as long as the loop is active, the module cannot continue and I cannot send commands to it.
I am looking for a way to basically launch a sub into the background, keep track of its pid, and be able to stop it at will.
The bot's architecture is:
bot.pl loads bot.pm which is the main module. bot.pm loads *.pm files which live in the plugins directory. A plugin can contain or more more bot commands.