Calling 'C' routines from perl.

P

Prathap

Hi All:


Can someone let me know how to invoke a 'C' routine from perl. I
have to develop an application
that requires Perl and C interactions. I need to know this in
detail. Please provide me with exmples or referances where I can learn
this.

Thanks for the help in advance.

Regards,
Prathap
 
P

Peter Makholm

Prathap said:
Can someone let me know how to invoke a 'C' routine from perl. I
have to develop an application

I believe that the easiest way is to look at Inline::C.

//Makholm
 
T

Ted Zlatanov

P> Can someone let me know how to invoke a 'C' routine from perl. I
P> have to develop an application
P> that requires Perl and C interactions. I need to know this in
P> detail. Please provide me with exmples or referances where I can learn
P> this.

I've been happy with Swig. It works with C++ as well and generates glue
libraries that work with Java and other languages.

Ted
 
P

Prathap

    perldoc -q ' C '

        Where can I learn about linking C with Perl?

Thanks for all the suggestions. Can you please explain with an example
why and how swig is useful?
How do I make C libraries and finally infoke them from Perl. It will
be of great quick help for me.

Regards,
Prathap
 
P

Prathap

I would stay away from SWIG. Its primary purpose is to create bindings
for lots of different languages from one source file, and IME perl
extensions built with SWIG (e.g. the SVN bindings) tend to be somewhat
awkward to use.


You give the impression that you haven't even written the C yet. You
need to do that first, and here is not the place to ask for help with
that. If you don't have a library that you know how to invoke from C,
you haven't a hope of invoking it from Perl.

You also need to read some of the documentation you have been pointed
at, and try writing something for yourself. You will not get any useful
help here until you say something like 'I wrote an XS/Inline::C file
that looks like this, and I expected X, but I got Y instead'.

Ben

I will do that. Just wanted a simplified introduction to the concepts.
Thanks for the referances you all have provided and I hope to get
things moving quickly. Will come back if any queries on my
experiments.

Regards,
Prathap
 
P

Prathap

I will do that. Just wanted a simplified introduction to the concepts.
Thanks for the referances you all have provided and I hope to get
things moving quickly. Will come back if any queries on my
experiments.

Regards,
Prathap- Hide quoted text -

- Show quoted text -

Thanks everyone. I read perlxstut and wrote few samples and they work
fine for me.

Regards,
Prathap
 
R

Ralph Malph

Prathap said:
Hi All:


Can someone let me know how to invoke a 'C' routine from perl. I
have to develop an application
that requires Perl and C interactions. I need to know this in
detail. Please provide me with exmples or referances where I can learn
this.

Thanks for the help in advance.

Regards,
Prathap
Sorry shitskin...no aid to the enemy.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top