in reply to socket programming
Maybe try changing the $cmd to:
$cmd = `ls`; [download]
That is, use backticks. Or at least remove the single ticks from your qx() assignment.