Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical

Using Existing C or/and Java Modules in Perl

by vennirajan (Friar)
on Dec 09, 2005 at 08:35 UTC ( #515483=perlquestion: print w/replies, xml ) Need Help??
vennirajan has asked for the wisdom of the Perl Monks concerning the following question:

Hi Gr8 ppl,

I want to use the existing C or/and JAVA modules ( header files - default sytem files or/and user defined files ) in Perl. Is there any way, i can achieve it ? I know that we can use the system calls using

use POSIX;

But this seems to be critical because of modules.

Waiting for your valuable inputs.
Thanks in advance.
S.Venni Rajan.
"A Flair For Excellence."
                -- BK Systems.

Replies are listed 'Best First'.
Re: Using Existing C or/and Java Modules in Perl
by tirwhan (Abbot) on Dec 09, 2005 at 08:39 UTC

    Take a look at the Inline modules, specifically Inline::C and Inline::Java, they make this really easy.

    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 W. Kernighan
Re: Using Existing C or/and Java Modules in Perl
by gjb (Vicar) on Dec 09, 2005 at 10:19 UTC

    For C/C++ ocde you can also have a look at SWIG, the Simplified Wrapper and Interface Generator. Of course, using XS is also an option, some information can be found in Advanced Perl Programming by Simon Cozens (and probably elsewhere, but that's what I used).

    Apart from the Inline::Java module mentioned above there's also Java which allows a Perl program to access a local or remote JVM.

    Hope this helps, -gjb-

      Thanks gjb. That advance perl programming link will be very much helpfull for me.
      S.Venni Rajan.
      "A Flair For Excellence."
                      -- BK Systems.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://515483]
Approved by jbrugger
[erix]: indeed had to be( time make check-world ) > test_run2.output 2>&1
[erix]: probably misremembered because of 2>&1 |
[erix]: oh nice, can do |& nowadays. Learned something new after all
LanX flagelates erix with a signed markov chain
[erix]: oh well, it's holy week, right? Thick-skin week. I just read that in the Philippines, some RCs practice self-crucifixion. Tough cookies I'd like to see
[LanX]: already?

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (10)
As of 2017-03-23 08:57 GMT
Find Nodes?
    Voting Booth?
    Should Pluto Get Its Planethood Back?

    Results (285 votes). Check out past polls.