Assuming the perl code is something like this…
open(STDOUT, ">$PName") || die "Can't redirect stdout";
$status = system("python Example.py $PName.txt");
(That is taken from http://www.linuxquestions.org/questions/programming-9/perl-script-call-python-linux-551063/)
What do I have to do in python to be able to pass a string to the perl script?
Would I need to simply return the string? or print to console? or something else?
The
systemcommand is not useful in Perl for capturing output of a command. You should use backticks to execute a command and write to stdout in the Python script.See the linked source below for more information.
Source: executing external commands in Perl