#fetch the (cgi)type cookie sub _cookie { #read in the lsrfm cookie to test my $self = shift; # my $cgi = CGI->new; # my $type = $cgi->param('type'); my $type = shift; #lets check to see if the lsrfm cookie exits #fecth the domains cookie my %cookies = fetch CGI::Cookie; my $cookies; my $lsrfm_cookie; if (!%cookies) { #a domain cookie doesnt exist #leave as blank } else { #a domain cookie exists #fetch the type value my $n = 0; my $this_cookie; my @cookies = (keys %cookies); foreach (keys %cookies) { $this_cookie = $cookies[$n]; if ($this_cookie eq ('LSRfm'.$type)) { $lsrfm_cookie = $cookies{'LSRfm'.$type}->value; } $n ++; } } return $lsrfm_cookie; }