| [reply] |
The source code is a test file like any other, and can be edited.
But since perl first compiles a script before it runs the mainline code, changes in the source script don't change the runtime behavior, unless you force it to (for example with exec).
But maybe you are trying to solve an XY Problem - what do you want to achieve in the end? Maybe there's a better (simpler, more robust) way?
| [reply] |
You can use the eval function to run perl code on-the-fly. I mean, supply some perl code to a running script, and from that script run the supplied code with the eval function. Whether or not that's a good idea is another matter. But is does sound a bit like a X-Y problem. Why do you think you need this feature, e.g. what are you trying to achieve?
Cheers
Harry
| [reply] |
I've used what Harry noted here to pull code from a Database and later a version control system. I built it so that if the eval fails it will try the next older version. This way the developers don't ever need access to the production servers and they have to load the code into version control to get it into production. Plus I built some nice "Change Management" around it. :)
-- BigJoeLearn patience, you must. Young PerlMonk, craves Not these things. Use the source Luke.
| [reply] |
What are you trying to do?
| [reply] |