in reply to Larry's Current Perl 6 Thinking

I would like to see Perl built in such a way so that it's easier to link it into other applications. Sure you can embed Perl, and we have things like the Safe module to restrict operations, but what if I have an application that I want to "extend" with Perl scripting, provide my own functions and the like for the script, and let the user provide the script? I'll certainly drop fork/exec from the list of things they can do, but is there a clean way of doing this at the moment? I guess at the moment I can just create a new interpreter in C, and have it load the Safe module, and generate a few lines of Perl to load my own functions/name spaces into the container, and then just execute the user's code in this container, but is there a better way?

Replies are listed 'Best First'.
RE: RE: Larry's Current Perl 6 Thinking
by AgentM (Curate) on Oct 31, 2000 at 02:05 UTC
    I don't understand. What kind of "better way" do you imagine? The perlembed interface is really simplified as it is. It works great and is easy to learn (I can't say the same about perlxs). Not only that, but you can load as many perl interpreters as you wish (though such functionality is not well-supported by perl.h). You can do all of that "unsafe" perl stuff in C while being able to handle everything else in Perl :-) This is actually the BEST way to write Perl code (if you're obsessive about such things....)
    AgentM Systems nor Nasca Enterprises nor Bone::Easy nor Macperl is responsible for the comments made by AgentM. Remember, you can build any logical system with NOR.
      But what if I don't want to make every feature in Perl available to scripters in my application? I may not want them to exec, fork or even sprintf. The Safe module provides a means of doing this, but is Perl 6 going to make this task any easier?

      A simple subset of Perl mainly for its abilities to provide decision-making to the user is sometimes all the scripting I want in an application. In addition, for "scriptlets" that I want to be executed repetitively, is there a way to tell Perl to compile this once, and execute it multiple times, perhaps with slight changes to variables in its name space? Getting Perl to work efficiently in this situation doesn't seem very easy at the moment. I guess I'm just wondering if Perl 6 will make it any easier.