i've had a lot of problems handling output when using the system command so normally i'll just use the back ticks to execute a command from the command line.
for example
$string = `command 2>/dev/null`;
puts the output of the command into string and the error code into /dev/null