Is CGI::Cookie a module you're using? If so, do you ever "use CGI::Cookie"?
Realize that there exists CGI::cookie() (the sub in package CGI), but that's not what you're calling. You're calling CGI::Cookie::new() (the constructor for the class, it looks like).