• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Using Java and Perl together...possible?

 
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I found a really nice Java API for distributed processing (called TSpaces by IBM) and I'd like to use it with some Perl code I have. How would I go about interfacing the two?
 
Bartender
Posts: 1844
Eclipse IDE Ruby Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Depends on exactly how you want to integrate the two. If all they are doing is sharing data, XML data streams can be sent between the two. If you want to call Java methods from PERL, you will likely need to use CORBA to interface between the two.
CORBA is not my strength (an neigher is PERL ), so perhaps others can offer other suggestions.
 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
you can execute a perl script within your java code. Try something like this
Process pr = Runtime.getRuntime().exec(perl cmd);
// Print command output onto standard output
InputStream is = pr.getOutputStream();
InputStreamReader isr = new InputStreamReader(is);
BufferedReader br = new BufferedReader(isr);
String str;
System.out.println("starting...");
while ((str = br.readLine()) != null) {
System.out.println(str);
 
Ranch Hand
Posts: 336
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you want to run java within perl try Inline::Java from CPAN.
 
Ranch Hand
Posts: 3451
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Nice to hear from you again Leslie. Have you written a perl script to scan JavaRanch so you can answer any question on perl that comes up?
 
Leslie Chaim
Ranch Hand
Posts: 336
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Nice to hear from you again Leslie
Same here, unfortunately I don't have that much time to ride the Moose these days.
Have you written a Perl script to scan JavaRanch
Not yet
Actually, it's the parsing part, which I rummage around for. It just happens that Perl is the greatest parsing tool.
Regards,
Leslie
 
I'm not dead! I feel happy! I'd like to go for a walk! I'll even read a tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic