Patrick Dupre wrote: > > It is a bit more complex. > > I am a perl routine calling a Cpp routine, > I wrote the xs to interface the call. > I wrote the methods (in Cpp) for the Cpp class. > In fact I need to use a Minuit2 class. > One needs to call a function with is written in perl (I had no doubt that > I call perl from Cpp !!) > It looks like that I have to options: > > 1) It is the class which is called by the perl that is going to call a > subroutine perl (nad I need to compile it to be callable by perl and to be > able the call perl), > > 2) I compile apart the class which call the perl from the class which > is going to be called by the perl. But this requires one more call: > a Cpp class calling a Cpp class: not very efficient. > > The reasons !! > My perl now it a urge program that including plenty of libraries. > The perl subroutine in perl that I need to reuse from Cpp is complex and > a was alot easier to write in perl than in Cpp (and it is easier to > maintain because of the hashes of hashes of hashes ...). > I want to use the MInuit package because it has been ported in perl and > I did not find any package doing such minimization. > > I know it is not simple, but it should be doable .
- Your purpose still isn't clear to me, but someone else may understand something that I haven't seen. I hope so - There is no public module called anything like Minuit2 or MInuit so I assume it is a private one - You say in previous messages that you have an XS module written that provides functions written in C and callable from Perl - You want to call subroutines written in Perl from the code of this XS module - Your plan was to embed a perl engine in the build of this extension So please check that the above are correct and then tell me these - The code to call a Perl subroutine from C is ugly but simple. Did you try that and did it work? If not then why not? - I have suggested that you read the advice in "perldoc perlcall" and call Perl routines that way. Have you tried this? What problems did you get when you tried? - Please consider publishing your code; ideally your /full/ code, so that we can see what you are trying to describe The bottom lines / points / frustrations are this - I cannot debug your code by guessing at all of the things that might be wrong with it. Help me to help you - Forget about embedding Perl into a Perl extension. All of the necessary code to compile and interpret a subroutine call is already there in your process. If something isn't working when you try to call a Perl subroutine then it isn't because you forgot to embed an additional perl compiler/interpreter into a Perl process - If you have already tried to code a call and it didn't work then you should have told us about it. Shame on you - If you haven't already tried to code such a call then do it now, and invite all of the regulars on this list to a big party when it works. I like good lemonade and lamb steaks with brown bread and plenty of salad please - When you've tried what we suggest and it doesn't work, tell us all about it and we will tell you what is wrong very soon - Never ask us for help and then ignore it because the idea doesn't fit with your vision. Even if ideas are stupid then we will cheer you for trying them. You will never be cheered for not trying things you didn't think would work Now go and try stuff... ... and when you've tried something, please tell us what it was and what happened. Rob -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/