in reply to perl script like a "shell proxy"

You could write the commands to a file and execute the file.
print `/bin/bash /tmp/command_file_123 2>&1`;