Passing data structure from java to perl (and vice versa)

A few days ago I asked about transferring a data structure from java to perl and vice versa, and one of the recos was JSON. I played with it (mostly using Gson for java) and it seems pretty nice. The only problem is that I have links inside my data structure (for other objects inside the same data structure). Currently, each such link is "fully translated", so each object is duplicated many times, and you cannot specify all these links pointing to the same object.

Is it possible to somehow transfer information from java to per and vice versa, preferably in a format suitable for human reading, which also stores link data instead of duplicating values?

+3
source share
2 answers

Like JSON, this is "YAML", and YAML allows you to specify exactly what you are describing. I believe that there is a YAML parser for Perl, and I know there is one for Java, because I use it in the current application.

http://yaml.org/

+4
source

I would suggest Inline :: Java to access the Java class from Perl and vice versa. After starting this interface, you can easily access the methods and attributes from the class.

+2
source

Source: https://habr.com/ru/post/1757141/


All Articles