I'm passing to perl from php using escapeshellarg
system("perl -e '" . escapeshellarg($inp) . "' >> /tmp/out");
And get unterminated quoted string from perl.
Input is: 'Single quoted terminated string ';
Please note that escapeshellarg
adds the outer single quotes itself.
So you should leave them out:
system("perl -e " . escapeshellarg($inp) . " >> /tmp/out");
# ^ ^ no extra ' quotes here