in reply to Re: MainLoop in Perl Module
in thread MainLoop in Perl Module

Or, you know, Coro if you don't want to mess with event-oriented programming. Sometimes one is easier, sometimes the other.