开发者

How can I access Perl variables in Java? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.

Want to improve t开发者_开发百科his question? Add details and clarify the problem by editing this post.

Closed 8 years ago.

Improve this question

I need to get an array from Perl script to Java program.

Can we directly access that variable in Perl directly from Java, or is there any way to return that array from the Perl program to the Java program?


A simple solution to transfer data from one process to another (no matter what language) is to use serialized strings.

Serialize your array to eg. a JSON String and deserialize it in the target process. If its a really simple data format, you could also use a field delimiter and simply concatenate the array fields with the delimiter.


For accessing Java class from Perl, I would suggest Inline::Java. Once you have that interface running you can easily pass different data structures.


A very simple solution to do this would be to write the array in a csv format and have your have program read from this file.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜