Help for this page

Select Code to Download


  1. or download this
    #!/usr/bin/perl
    # example_5-1.cgi
    ...
    print qq(A cookie has been set in your browser...<P>);
    print qq(<A HREF="example_5-2.cgi">);
    print qq(Click to view the cookie</A>);
    
  2. or download this
     #!/usr/bin/perl
    #example_5-2.cgi
    use strict;
    my ($key,$value) = split(/=/,$ENV{HTTP_COOKIE});
    print qq(Content-type: text/html\n\n);
    print qq(The cookie <B>$key</B> contained <B>$value</B>);