文件test内容:
linux = redhat
redhat = linux
我在一个CGI程序中将它读入到一个哈希数组中再把他打印出来
#!/usr/bin/perl -w
use CGI qw/:all/;
print header;
//
........
//是我读取文件的代码
start_html(A Simple Example),
h1(A Simple Example),
start_form,
"linux关键字的值",textfield(linux),p,
"redhat关键字的值?", p,
popup_menu(-name=>redhat,
-values=>[linux,unix,windows,Solaris]),p,
submit,
end_form,
hr;
在这个程序中我想要把在读文件时所取得的数据作为CGI程序中textfield(linux)和popup_menu(redhat)然后又可以对之进行修改再提交对文件进行改写。现在我想知道我这样写法对不对及怎样把所取得的数据赋给CGI程序中的textfield(linux)和popup_menu(-name=>redhat如果我这种方法不对那么这个程序的正确写法应该是怎样的?
利用GET的方法可以完成你说的
把你需要提交的在程序中用变量popup_menu(-name=>$redhat
然后用GET的方法来使程序得到这个变量值
就是说先提交一个GET请求,得到一个变量的值
就是你需要的!
I still dont understand what you said!