CGI:Cookies的用法

687阅读 0评论2009-10-29 hao3721
分类:

刚刚不知道为什么,文章没有了,只好重新发布:

#!/usr/bin/perl

use CGI qw/:standard/;
    use CGI::Cookie;

    # Create new cookies and send them

    my $cookie1 = new CGI::Cookie(-name=>'ID',-value=>123456);
    print header(-cookie=>$cookie1,-charset=>"gb2312");
    print start_html();
    my %cookies = fetch CGI::Cookie;
    my $id = $cookies{'ID'}->value;
    print h1($id);
    print end_html();


上一篇:perl源码 将简单留言板的代码重新整理一下,期待高手提拔。
下一篇:推荐一个perl/CGI的编辑工具