in reply to Re: Return values to outside programs
in thread Return values to outside programs

Thanks for those replies. My return values are complicated, being String, integer, octal and boolean (either singly or combined). I was looking at pipes just after I posted, but they don't appear to solve my problem. I'll investigate perlipc (have not done that yet, was not aware of it). Since my returns may be only one line of 'text' or several hundred thousand, depending on the search criteria entered I'm strongly leaning towards write to disk, read from disk as the most efficient way to solve my problem.
  • Comment on Re^2: Return values to outside programs

Replies are listed 'Best First'.
Re^3: Return values to outside programs
by glasswalk3r (Friar) on Aug 21, 2009 at 13:54 UTC

    You could use data serialization with XML. That way you can get the data back as a Java object. The Perl program just need to write the results somewhere as a file.

    If this is too simple for you application (like it receives several concurrent requests) then you should look for using sockets and XML.

    Alceu Rodrigues de Freitas Junior
    ---------------------------------
    "You have enemies? Good. That means you've stood up for something, sometime in your life." - Sir Winston Churchill

      You could also use JSON instead of XML, which is easier to parse and produces less overhead. JSON interfaces exist for all major and a lot of minor languages, including, of course, Perl, Java, Javascript, C, C++, and C#.

      Alexander

      --
      Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)
Re^3: Return values to outside programs
by ig (Vicar) on Aug 23, 2009 at 06:56 UTC

    If you have large, complex data sets, you might consider a database as an intermediary rather than serialization to a file.