What is the best/easiest way to execute a command line function in Perl, such that I can get the output as a String?
What I'm actually trying to do is call a Java program from within a PL/Perl function in PostgreSQL, and I want the output String, however at the moment it seems to just be returning 0.
Here is a simple piece of code to explain what I am after:
CREATE OR REPLACE FUNCTION perl_func()
RETURNS character varying AS
$BODY$
return system("java -version");
$BODY$
LANGUAGE plperlu VOLATILE
COST 100;