http://qs321.pair.com?node_id=366343


in reply to Draft - Writng plugable programs with perl.

This is very similar to a plugin system that I built for (wait for it...) an IRC bot. I needed to be able to unload plugins, though. So instead of using require, I just used do. This got rid of the %INC check, which is nice, but for my purposes just a hassle. I then used delete_package from Symbol (this is a core module) to remove the plugin. Also, instead of running the subroutines immediately, I store the coderef returned by can() in a dispatch table.

Obviously my plugins work a little differently due to their different purpose, but perhaps some others will find this information useful.