TESTING revision 6499
5477N/A========================== Create file /var/tmp/a.pl ===========================
5477N/Ause strict;
5477N/Ause warnings;
5477N/A
5477N/Ause CGI;
5477N/A
5477N/Amy $q = CGI->new;
5477N/A
5477N/A# Process an HTTP request
5477N/Amy @values = $q->multi_param('form_field');
5477N/Amy $value = $q->param('param_name');
5477N/A
5477N/Amy $fh = $q->upload('file_field');
5477N/A
5477N/Amy $riddle = $q->cookie('riddle_name');
5477N/Amy %answers = $q->cookie('answers');
5477N/A
5477N/A# Prepare various HTTP responses
5477N/Aprint $q->header();
5477N/Aprint $q->header('application/json');
5477N/A
5477N/Amy $cookie1 = $q->cookie(
5477N/A -name => 'riddle_name',
5477N/A -value => "The Sphynx's Question"
5477N/A);
5477N/A
5477N/Amy $cookie2 = $q->cookie(
5477N/A -name => 'answers',
5477N/A -value => \%answers
5477N/A);
5477N/A
5477N/Aprint $q->header(
5477N/A -type => 'image/gif',
5477N/A -expires => '+3d',
5477N/A -cookie => [ $cookie1,$cookie2 ]
5477N/A);
5477N/A================================================================================
5477N/A
5477N/A$ perl /var/tmp/a.pl
5477N/AContent-Type: text/html; charset=ISO-8859-1
5477N/A
5477N/AContent-Type: application/json; charset=ISO-8859-1
5477N/A
5477N/ASet-Cookie: riddle_name=The%20Sphynx%27s%20Question; path=/
5477N/ASet-Cookie: answers=; path=/
5477N/AExpires: Sat, 25 Jun 2016 10:55:24 GMT
5477N/ADate: Wed, 22 Jun 2016 10:55:24 GMT
Content-Type: image/gif; charset=ISO-8859-1