You're never using the value of $cmd.
Maye you wanted $result = `$cmd`; ?
In reply to Re: Running a Shell Program from CGI page by Corion in thread Running a Shell Program from CGI page by sauravrout