Update:
It seems the cmd_str is a problem. It is a very long list of parameters and contains blanks, semicolons, double quotes. Somewhere there must be a problem, because when I issue the Perl script without parameters it returns a RC of 1 which is also displayed when I alter it in the script.
I have to check how I can encapsule that long string so that it will be handed over correctly and if the correct RC will be displayed.
Update:
I found out, that when there is a semicolon in string variable, that is handed over to system(), it will give the RC = 0, because the parameters delimeted by the semicolon are things like "msg=blabla" and this is a valid variable definiton in the shell, so it's RC = 0
test.sh worked, because it had a shortened version of the command, where the semicolons were left out... sorry.
I tried escaping it, but that doesn't help - any ideas are welcome.
I can't change the delimeter to something else, because the server on the other side expects them as delimeter.