my $cookie = $ENV{'HTTP_COOKIE'}; # if you wanna do this like that. @all = split(/\;/, $cookie); foreach (@all) { ($var, $value) = split(/=/); $values{$var} = $value; } #### my $username = $values{'username'}; my $password = $values{'password'}; # now do whatever you want with them.