Hi,

Let's say if I create a cookie with $questions and $answers value pairs where 
$questions consists of q1, q2, q3, q4, q5, while $answers consists of a1, a2, a3, a4, 
a5.
I have no problem in printing out every value of a cookie by using

my %answers = $q->cookie("my_cookie");
if(%answers)
  {
   foreach $name(%survey_ans)
   {print "$name :\n";
    }

results : q1 : a1 :q1 :a2 :q3 :a3 :q4 :a4 :q5 :a5.
    
but I am facing a problem on retrieving a specified attribute in a cookie.

my $value_1 = $q->param(-name=>'q1', -value=>[$q->cookie('my_cookie')]);
my $value_2 = $q->param(-name=>'q2', -value=>[$q->cookie('my_cookie')]);
my $value_3 = $q->param(-name=>'q3', -value=>[$q->cookie('my_cookie')]);
my $value_4 = $q->param(-name=>'q4', -value=>[$q->cookie('my_cookie')]);
my $value_5 = $q->param(-name=>'q5', -value=>[$q->cookie('my_cookie')]);

results : q1

The rest of the parameters are not replied.  Is my cookie corrupted? but I managed to 
print everything out. Or is my $value_x defined wrongly?

Kindly Advice...  Millions Thanks!






Reply via email to