Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^5: Doubts of a perl beginner on PERLEMBED

by robin (Chaplain)
on Dec 17, 2005 at 15:25 UTC ( #517494=note: print w/ replies, xml ) Need Help??


in reply to Re^4: Doubts of a perl beginner on PERLEMBED
in thread Doubts of a perl beginner on PERLEMBED

If you're calling the Perl code repeatedly from the C, that's a reasonable thing to do, because you need only compile it once.

The best way to do it is probably to make sure all your Perl code is in subroutines (so running the script from the command-line) doesn't actually do anything), and that you don't have any name clashes between the two files. (Use separate packages if necessary.)

Then load both the files in, by parsing (perl_parse) and executing (perl_run) a one-liner that requires them both, as I indicated earlier. Once you've done that, you can call your subs using one of the call_* functions described in perlcall.

Good luck! Embedding perl is a pretty “advanced” topic for a self-described perl beginner. Good for you for not being afraid to try! But don't expect it to be particularly easy or clearly documented...


Comment on Re^5: Doubts of a perl beginner on PERLEMBED
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://517494]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (8)
As of 2014-07-24 07:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (158 votes), past polls