Try explicitly setting a path in the cookie you're creating, one broad enough to encompass BOTH scripts you're testing. So:
$cookie_out = $q->cookie(-name=>"wolves", -path=>'/', #or -path=>'/cgi
+-bin/' for your cgi-bin directory
Will make it valid for your entire site. When an explicit path is not set, browsers may interpret where a cookie is valid for differently. Where does that get you?
-Any sufficiently advanced technology is
indistinguishable from doubletalk.