in reply to Changing "filename" of eval-ed code

#line

string eval is baad, mmkay :p

  • Comment on Re: Changing "filename" of eval-ed code

Replies are listed 'Best First'.
Re^2: Changing "filename" of eval-ed code
by Discipulus (Canon) on May 20, 2016 at 08:41 UTC
    One good quote?
    Perl was not designed to stop you from doing stupid things, because that would also stop you from doing clever things. Plus nobody can stop you from doing stupid things.

    other arguments needed?

    Being my opinion not globally relevant, I ever considered eval a great gift: the compiler walk silently at your side; at any moment you can ask him what if I.. eval answer always adhere to the reality, ie the Perl compiler. Obviously at your own risk..

    L*

    There are no rules, there are no thumbs..
    Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.
Re^2: Changing "filename" of eval-ed code
by davido (Cardinal) on May 20, 2016 at 15:12 UTC

    Not bad, just accompanied by a heightened level of risk and complexity. Manage those effectively, and it's a useful tool.


    Dave

Re^2: Changing "filename" of eval-ed code
by perlancar (Hermit) on May 20, 2016 at 12:13 UTC
    What is the alternative for dynamic code execution? require(), do()? They're basically the same thing as eval "", only more cumbersome :)