If you plan on inserting the output of the command directly into your HTML, just use system(). If the command has output and you do not want the output to be inserted into the HTML, you are going to have to redirect or intercept the output.
The simplest way to redirect the output on UNIX using system() is to append ">/dev/null" (to throw away stdout) or ">/path/to/logfile" (to keep stdout in a logfile). On WIN32 the same can be accomplishing using ">NUL" and ">c:\\path\\to\\logfile". For example:
system("echo hello >/dev/null");
To intercept the output use ``:
my $output = `echo hello`;