use CGI qw(:standard); use Expect; print "Content-type: text/html\n\n"; print "test1\n"; $htpasswd = "/usr/local/apache/bin/htpasswd $htpasswdfile $formuser"; ($htpass = Expect->spawn("$htpasswd")) || die "could not spawn program, $!"; print "test2\n"; exit;