Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想从 perl 文本框中读取一个值 jj
print $q->textfield( -name => 'UserName', -value =>'jj', -size => 15, -maxlength =>40, );
我曾经读过
my $txt=$q->param('UserName');
但它不是从文本框中读取的。
param将为您提供通过 POST 提交的数据或向 CGI 程序提交的查询字符串。它不会为您提供将以您之前在脚本中输出的形式出现的数据。
param
如果您想知道这一点,请在开始使用之前将数据放入变量中。
my $txt = "jj"; print $q->textfield( -name => 'UserName', -value => $txt, -size => 15, -maxlength =>40, );