in reply to reading javascript cookies

Assuming they're already set, you read them just like any other cookie. I'd suggest reading the docs of CGI::Cookie. Something like this would work:
use CGI::Cookie; # fetch existing cookies %cookies = CGI::Cookie->fetch(); print $cookies{'cookie_name'}->value;
If you are already using CGI.pm, you should just use the cookie methods it provides (see the doc).