in reply to Reading and executing Perl


You can use eval, but basically that is not a good method, if your that external file is changeable by every other users. Then you have very big problem on hand(`rm -rf /` is also possible there, how you would check it?).
I think your requirement can be solved easily by adopting some other methods, not the one which you are talking about.

Vivek
-- In accordance with the prarabdha of each, the One whose function it is to ordain makes each to act. What will not happen will never happen, whatever effort one may put forth. And what will happen will not fail to happen, however much one may seek to prevent it. This is certain. The part of wisdom therefore is to stay quiet.

Replies are listed 'Best First'.
Re^2: Reading and executing Perl
by bingohighway (Acolyte) on Apr 02, 2009 at 12:20 UTC
    Unfortunately it has to be done this way. It is basically translating a preprocessor style tagging system for a lot of old code that can't be altered.
    I'll give your suggestions a try, cheers!
      I see your point about 'rm' though. Currently I'm only allowing know tags through, hence the idea of stripping the 'if' and then using the code's own 'if'. Meaning only the logic section would be used. If that makes sense.