in reply to Reading the script code from itself
I agree with Anonymous Monk on this one ... this sounds like an XY Problem. If what you need is a configuration-file, there are lots of good ways to do that. If, on the other hand, you need constants to be declared within your source code, that is generally what the interpreter is meant for. There are ways, like __DATA__, to embed text into the source-code (so that you can always find it). But if you simply say that you want to arbitrarily read the source-code of the module that you’re executing, without giving any of us any idea why you are doing so, then this very strongly implies that you might be chasing after a red herring or a white rabbit. Please tell us briefly what you want to do achieve.