#! /usr/bin/perl -w use strict; use CGI; my $q = new CGI; my @result; # other stuff happens if ($q->param('command') eq "command1") { # Notice how I pass NOTHING to the # system command that was handed to # the CGI script. @result = `/usr/local/bin/script.sh`; } elsif ($q->param('command') eq "command2") { # command 2... } # more stuff happens. # Include code to render your html around here # then display the result of your system command here: print join "
", @result; # Close out your html document.