What is the equivalent of PHP's $_POST in a Perl CGI script and how can I use it?
- by dexter
I have two Perl files: action.pl and the other is test.pl
action.pl has a form:
print $cgi->header, <<html;
<form action="test.pl" method="post">
html
while (my @row = $sth->fetchrow)
{
print $cgi->header, <<html;
ID:<input name="pid" value="@row[0]" readonly="true"/><br/>
Name: <input name="pname" value="@row[1]"/><br/>
Description : <input name="pdescription" value="@row[2]"/><br/>
Unit Price :<input name="punitprice" value="@row[3]"/><br/>
html
}
print $cgi->header, <<html
<input type="submit" value="update Row">
</form>
html
What should I write in test.pl so as to access the form values submitted by the user?
In other words, what equivalent of PHP's $_POST['pid'] in Perl?