Since you're mentioning the bad headers problem I assume that you're running your script as a CGI. Then you should probably print something like "Content-type: text/plain".
To get the STDOUT of a system call you should use the backticks ("`") or the
qx/ls/-way. Using
system() just gives you the return value of the call (which is zero in most cases) not their output. Actually this is quite a FAQ since it is asked many times.
If the script dies complaining there is probably an error in it that lets it die before any reasonable output appears. Are you sure you got
IO::Scalar installed? Have you tested running it on your local machine? Have you access to the webservers logfiles (where you could find more messages)?
If I got things wrong -the webserver assume- please excuse...