Laurent -

Have you seen perlcall? http://perldoc.perl.org/perlcall.html

Check out the examples section and see if they make sense. If not, let us
know and we'll see if something is broken. FWIW, I've called Perl subs from
my C code before, so I know it's possible.

David

On Mon, Mar 5, 2012 at 5:01 AM, <laurent.ha...@voila.fr> wrote:

> Hello,
>
> First, thanks for the Inline::C package, which is well build, and very
> usefull for me.
>
> I would like that "C code"   call   "perl sub"    but    many times.
>
> When I execute the script I have a "panic: memory wrap"...
>
> Is there a solution to do that...
>
> Thanks.
>
> Laurent
>
>  use Inline C;
> # use Inline 'NoClean', 'FORCE', 'INFO' ;
> # use Inline Config => WARNINGS => 4;
>
> use strict;
>
> # c_func_1('This is the first line');
> c_func_2('This is the second line');
>
>     sub perl_sub_1 {
>         print map "$_\n", @_;
>     }
>
> __DATA__
> __C__
>
> void c_func_1(SV* text) {
>  c_func_2(text);
> }
>
> void c_func_2(SV* text) {
>
> int i = 0;
>
> for (i=0;i<10;i++)
> {
>  perl_call_pv("main::perl_sub_1", 0);
>  //SPAGAIN;
> }
>
> }
>
> void cont (void) {
> }
> ___________________________________________________________
> Les 10 aliments pour lutter contre le rhume ou la grippe sont sur Voila.fr
> http://actu.voila.fr/evenementiel/sante-bien-etre/aliments-anti-rhume/




-- 
 "Debugging is twice as hard as writing the code in the first place.
  Therefore, if you write the code as cleverly as possible, you are,
  by definition, not smart enough to debug it." -- Brian Kernighan

Reply via email to