我正在尝试从 html 运行 perl 脚本,但在执行过程中出现错误。这是我的 html 和 2 行 perl 代码。错误代码的描述性不是很好,只是说“内部服务器错误”和其他一些行。我还想知道如何在 perl 脚本中显示接收用户名。
pwd
/var/www/cgi-bin
ls -l
total 4
-rwxr-xr-x 1 root root 49 Aug 26 16:49 username.pl
html代码:
<html>
<head>
</head>
<body>
<h1> Hello </h1>
<form action="/cgi-bin/username.pl" method="POST">
<input type="text" name="username">
<input type="submit">
</form>
</body>
</html>
Perl代码:
#!/usr/bin/perl
print "Received user name is\n";