http://www.perlmonks.org?node_id=1006924


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'

Replies are listed 'Best First'.
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