in reply to Safe forking

I realize this totally dodges the question of "safe forking", but I think you'll be much better off with an event loop framework like POE. The API takes a bit of getting used to, but once you do, it's quite powerful. See POE::Component::IRC and e.g. http://poe.perl.org/?POE_Cookbook/IRC_Bots.