gaggio has asked for the wisdom of the Perl Monks concerning the following question:

I know.

This is a little sad, but I am using MS Visual C++ at work, because I must use it.
I am using Perl also, though, and it saves me lots of time. The only thing that I would like to do is to be able to embed Perl directly inside my C++ program.

I know that there are references about the subject (I am just coming back from the PerlMonk library), but I have not been able to find anything related to VC++. And we all know that VC++ is a compiler different from gcc.
So, my question should maybe rather be "Has anybody already embeded Perl code inside a VC++ project?".

Thanks in advance for the Wisdom that I will find.

Replies are listed 'Best First'.
Re: Embedding Perl in Visual C++
by buzzcutbuddha (Chaplain) on Jul 05, 2000 at 16:07 UTC
    Last month's Visual C++ Developers Journal had an article on embedding Perl in Visual C++. If you work with other VC++ developers, I would suggest asking one of them to lend you the magazine, barring that, I would be happy to photocopy the article for you and mail it to you. In the meantime, I will see if I can lift the code from their website and post it here for all to peruse.

    HTH,
    Maurice

    Update: The code associated with the article is several pieces long, and I would prefer not to post it, but I would be happy to email it to whoever would like it. It's in zip format, so if you don't have Zip, I'll put it into a Self-Extractor for you, or, I can unzip and email the individual pieces, just let me know!
      Hi, If you get the photocopy,please mail it to me too. mailto:utility@cmmail.com Thank you.
      This would be awesome.
      Let me know if you find it.
      I'll try to find it also.
        Well, I did not find anything on the VCDJ website. I would be really pleased to get that article mailed then. Let me know how you think we will do that.
        Thanks a lot for your input.
Re: Embedding Perl in Visual C++
by vkonovalov (Monk) on Jul 05, 2000 at 12:11 UTC
    MSVC++ can compile perl from source code, as ActiveState do in their Perl distribution. There should be no problem embedding Perl, and you can do this two different ways - in a standard way and second, deprecated way, via PERL_OBJECT.

    There is nothing bad using MSVC++. It producess fastest code nowadays for Win32.

      Say what?? MSVC++ is horrible. It does annoying things like assigning the same memory address to a loop control variable and the last element of an array. By my experience, CodeWarrior produces MUCH faster code.
RE: Embedding Perl in Visual C++
by Cybercosis (Monk) on Jul 05, 2000 at 10:45 UTC
    Indeed, the MSVC++ compiler couldn't even be said to be ANSI compliant (we'll not get into the issues I've had with variable addresses... *shudder*) Probably your best bet would be to embed the perl interpreter in your program, ala perlman::perlembed. Hope this helps!
    ~Cybercosis