in reply to Reading the script code from itself

You certainly could do it as you suggest, e.g. opening __FILE__ and using a regex to parse out the constants. There are theoretically other ways to parse the source (e.g. PPI) or even dig into the symbol table... however, this really smells like an XY Problem, and if you could explain the broader picture and what you're trying to accomplish, I'm sure we could come up with some better solutions to the original problem.

  • Comment on Re: Reading the script code from itself