On Tue, May 17, 2005 at 03:00:14PM +0100, Colin Paul Adams wrote:
> But when I look at http://www.parrotcode.org/docs/embed.html, I can
> see no way of getting information back from the script - not even an
> exit code. Is there anyway of doing this that I have missed?

You may wish to use Parrot_call_sub's "SS" form, where you pass in a
string and get back a string.  Something like this:

    my $interp = Parrot_new(undef);

    # ... load a .pir file or some other code into $interp ...

    my $code_pmc = Parrot_find_global(
        $interp,
        const_string("Namespace"),
        const_string("sub_name"),
    );

    my $return_str = Parrot_call_sub(
        $interp,
        $code_pmc,
        const_string("SS"),
        const_string("Your_input_string_here"),
    );

Thanks,
/Autrijus/

Attachment: pgpgNF7AWTweJ.pgp
Description: PGP signature

Reply via email to