in reply to Redefining Subroutines on the Fly in a Persistent Application

Hmmm... There's no way to get around the eval. You might be able to avoid the "subroutine x redefined" messages by using a hash of anonymous subs to store your actual routines, then either use the autoload function to execute them on demand, or implement a bunch of stub subroutines that just call whatever they're named after. Don't know if this might be leaky, though-- does Perl do garbage collection of dereferenced anonymous subs? It should. This is probably similar to what Apache::Registry does.

stephen

  • Comment on Re: Redefining Subroutines on the Fly in a Persistent Application