in reply to unix commands

Try IPC::Open3, it lets you open a process for writing, and reading from stdout and stderr.
$pid = open3(\*WTRFH, \*RDRFH, \*ERRFH, 'some cmd and args', 'optarg', ...);