Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic

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?

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (5)
As of 2014-08-01 00:28 GMT
Find Nodes?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:

    Results (256 votes), past polls