Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Perl / Java

by chhe (Sexton)
on Mar 28, 2002 at 15:37 UTC ( [id://155006]=perlquestion: print w/replies, xml ) Need Help??

chhe has asked for the wisdom of the Perl Monks concerning the following question:

Dear Monks,

hopefully i am not boring you with the reiteration of a not so interesting question:

What are the possiblibilities for "embedding" Perl programms in Java applications. The most obvious solution is to execute a perl programm, through the with the Class Exec. But this probably doesn't scale....

Another possibility would be to have to two seperate processes, one perl and one java, and have them communicate through tcp/ip sockets based some application level protocol.

Are there other possibilities?

Your humble seeker of perl wisdom, Chris

Replies are listed 'Best First'.
Re: Perl / Java
by broquaint (Abbot) on Mar 28, 2002 at 15:46 UTC
    Another forum that might also be helpful on this topic is Java Junkies.org.
    If it would help, you could go in the reverse direction and embed Java in Perl (crazy huh?). "Impossible!" I hear you say, but thanks to the ever-amazing Inline module you can embed pretty much anything in perl, including Java.
    HTH

    broquaint

      I'll second that recommendation. Inline::Java is just too cool.

      And when I started looking for an answer to the same question you're asking, I found out that I::J has pretty well supplanted JPL.
      --
      Mike

Re: Perl / Java
by perrin (Chancellor) on Mar 28, 2002 at 16:26 UTC
    JPL, originally by Larry Wall, allows you to write Java classes in Perl. However, this is almost certainly a terrible idea and you should re-think what you're doing here. Mixing multiple languages always involves translation of variable types and other glue code which tends to make this kind of solution both slow and prone to bugs. The only language that truly plays well with perl for embedding is C.

    Maybe if you explain the problem you're trying to solve, someone here could suggest a better way to do it.

Re: Perl / Java
by Dog and Pony (Priest) on Mar 28, 2002 at 16:07 UTC
    I was really, really sure that I had seen something that allowed this somewhere, probably on O'Reilly, since I once looked for just the same thing. Now I can't find it anywhere, so either I was dreaming or they have removed it - it was a while ago, after all.

    Anyhow, I did find this extensive (not) link about something called JPerl, which looks like exactly what you want. However, looking more closely, it seems to be quite old, but that doesn't mean that it can't work - and maybe you can see how that one worked and adopt it to newer versions... hopefully realeasing a new cool version back into the wild. :)

    (It is also possible that this is what I thought I remembered, although if so, it was packaged and sold earlier (say a few years back). It is possible.)


    You have moved into a dark place.
    It is pitch black. You are likely to be eaten by a grue.
Re: Perl / Java
by trs80 (Priest) on Mar 28, 2002 at 17:57 UTC

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://155006]
Approved by root
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (5)
As of 2024-04-23 19:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found