thoglette has asked for the wisdom of the Perl Monks concerning the following question:

For better or worse, we have a Java GUI which calls various Perl scripts. Now java.pm is used to communicate betwixt & between and the port number is passed explicitly as a parameter to the Perl script.

Which is, ah, inconvenient. We would like to hide in within our gui-handling module (which includes java.pm)

What mechanisms are a) available b) commonly used by *.pm modules to resolve this problem?

Off the top of my head, the following are possible

  1. Stick to single user mode and hard code the port id (perhaps as an environment variable
  2. use a fixed negotiation port and negociate (as per TCP) for ports on a case-by-case basis
Any ideas or references to standard solutions

Thanks!