http://qs1969.pair.com?node_id=517395


in reply to Doubts of a perl beginner on PERLEMBED

(3) My third question is ---I have to call 2 different perl subroutines in 2 different perl files from a C file. So i want to know whether i will to have initialize 2 seperate occurances of "PerlInterpreter" . If it is possible to use same "PerlInterpreter" for calling 2 different perl files ,could you please specify how.
Is there any reason you can't just combine the two files into one?

You can probably load both files into the same perl interpreter using require. So something like

char *my_args = { "perl", "-e", "require 'file1.pl'; require 'file +2.pl'" }; ... perl_parse(my_perl, NULL, 3, my_args, (char **)NULL);
might well work for you. (Of course it will cause problems if both files use the same subroutine name.)