For a class, I have to pass data from a CGI (written in Perl) script to a Java program. This is easy enough, but I need to make the Java program return the data it finds to the CGI script. Can someone tell me how to do that?
depends on how you are passing the data to the java program. If you are running it as a command line application then you can just print the output from the java program to the standard output device and use backticks (`) to call the java program
perlvar = `java MyJavaApp param1 param2`
thats how I would go about it, its not the most safe and secure way mind, so make sure you do a damn good job of cleaning any parameters you are passing to the java program so that you dont get random code executed alongside your call to the java program