in reply to Redefining Subroutines on the Fly in a Persistent Application
So in my mind, at least, it seems that you'd get faster results using eval.
I don't know exactly how you're using this code, but you might also want to implement some sort of package naming scheme (ie. so that they're not all in the Sub package)--perhaps come up w/ a unique numbering mechanism or something like that (so that you don't have the namespace issues like "Subroutine ____ redefined")?
Finally, this seems conceptually similar to what the Apache modules do, particularly Apache::Registry. You may want to take a look at that to see how it's implemented--perhaps you could get some tricks from there? From the perldoc I read (very quickly), it sounds like they're taking the source, eval-ing it, then keeping the compiled code around in memory so that it can be invoked as a handler.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
RE: Re: Redefining Subroutines on the Fly in a Persistent Application
by chromatic (Archbishop) on Feb 25, 2000 at 21:47 UTC |