What is the equivalent of PHP's $_POST in a Perl CGI script and how can I use it?

Posted by dexter on Stack Overflow See other posts from Stack Overflow or by dexter
Published on 2010-03-31T09:49:21Z Indexed on 2010/03/31 11:23 UTC
Read the original article Hit count: 203

Filed under:
|

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?

© Stack Overflow or respective owner

Related posts about php

Related posts about perl