Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Java programming and Perl

by tobyink (Abbot)
on Dec 03, 2012 at 18:36 UTC ( #1006924=note: print w/ replies, xml ) Need Help??


in reply to Java programming and Perl

It's possible to call Java code from Perl using Inline::Java. An example module that does so is XML::Saxon::XSLT2.

There are similar inline modules for other programming languages - Inline::C, Inline::Ruby, Inline::Lua, etc.

The other way around - calling Perl from other programming languages - is also possible. Perl can be compiled as a library ("libperl") which can be embedded into C programs; and thus theoretically be called from any other programming language capable of linking against C libraries. There exists a PECL module allowing Perl to be embedded in PHP.

I don't think this would be a fruitful or indeed sane way of getting Perl running on Android though. Maybe look at perldroid?

perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'


Comment on Re: Java programming and Perl
Re^2: Java programming and Perl
by heatblazer (Scribe) on Dec 03, 2012 at 18:40 UTC

    So let`s say I can make a libperl then call it like a C code with java native interface?

      Yes - as I understand it, this is what perldroid does.

      perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'

        I`ll look at it ASAP. I am intermediate Perl user and I want to add it`s functionality to java programs so I guess it`s my choice.

        Thank you

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1006924]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (8)
As of 2014-10-30 13:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (208 votes), past polls