NickBot is an IRC bot framework written in Perl. It is designed such that all of the user modules that do the actual data processing are located in an external file. Each module is run individually inside of Perl's eval function to keep rouge modules from crashing the entire bot; plus this gives the user the ability to add/remove/change modules in the bot without restarting it every time.
NickBot's main program consists of a large number of generic handlers. Each handler takes the information that the Net::IRC module gives it and either responds appropriately (like with a ping request), or it processes it into a generic format. This generic format then goes through a couple more steps to determine things like was the bot addressed, and what type of message came in. At that point, the collected data is passed off to the user modules.
The user modules are what really give NickBot it's flexibility, the user can go into the modules file and make any number of modules to make the bot actually do something. Included in the distribution is a sample modules file that I've created during development to test out the interface. The bot doesn't do anything spectacular out of the box, but you can implement your own functions.