in reply to Re^2: How to call perl in Java?
in thread How to call perl in Java?

Passing Java objects to Perl subs sounds tricky, objects can be arbitrary complex. Maybe you can use JSON for data transfer. You could serialize your Java object to a JSON string, pass it to Perl and decode it. See JSON in Java and JSON.

HTH

Harry

Replies are listed 'Best First'.
Re^4: How to call perl in Java?
by llancet (Friar) on Jan 13, 2010 at 04:45 UTC
    I know that Inline::Java is able to use Java objects in perl code...

      Perhaps I was not clear, for the JSON approach I meant communication between a JVM and Perl, not as in Java glued into Perl, i.e. the inline solution. If you're happy with mixing java and Perl in one file it seems like the most straightforward solution to me. I'd prefer to separate things. Is it a use-once solution or will you need this type of communication a lot in the future? It might be worthwhile to explore other solutions. More work though.

      Cheers

      Harry

        I'm conceiving about a workflow controlling software. It might be better to use Java to implement the skeleton, because Java is more strict than perl. However I still want it possible to use perl to implement the procedures, because it's flexible and fast to develop.

        Actually it's only a optional way of solution, and now I'm using perl to implement the whole architecture, but suffering from perl's loose hierarchy system.